Change:Fallback to audio stream tags if probe format has no tags and remove old scanner #256

This commit is contained in:
advplyr 2021-12-24 18:06:17 -06:00
parent 3f8551f9a1
commit a17348f916
12 changed files with 97 additions and 1269 deletions

View file

@ -5,7 +5,6 @@ const date = require('date-and-time')
const Logger = require('./Logger')
const { isObject } = require('./utils/index')
const audioFileScanner = require('./utils/audioFileScanner')
const BookController = require('./controllers/BookController')
const LibraryController = require('./controllers/LibraryController')
@ -18,9 +17,8 @@ const BookFinder = require('./BookFinder')
const AuthorFinder = require('./AuthorFinder')
class ApiController {
constructor(MetadataPath, db, scanner, auth, streamManager, rssFeeds, downloadManager, coverController, backupManager, watcher, cacheManager, emitter, clientEmitter) {
constructor(MetadataPath, db, auth, streamManager, rssFeeds, downloadManager, coverController, backupManager, watcher, cacheManager, emitter, clientEmitter) {
this.db = db
this.scanner = scanner
this.auth = auth
this.streamManager = streamManager
this.rssFeeds = rssFeeds
@ -167,8 +165,6 @@ class ApiController {
this.router.get('/filesystem', this.getFileSystemPaths.bind(this))
this.router.get('/scantracks/:id', this.scanAudioTrackNums.bind(this))
this.router.post('/syncUserAudiobookData', this.syncUserAudiobookData.bind(this))
this.router.post('/purgecache', this.purgeCache.bind(this))
@ -362,19 +358,6 @@ class ApiController {
res.json(dirs)
}
async scanAudioTrackNums(req, res) {
if (!req.user || !req.user.isRoot) {
return res.sendStatus(403)
}
var audiobook = this.db.audiobooks.find(ab => ab.id === req.params.id)
if (!audiobook) {
return res.status(404).send('Audiobook not found')
}
var scandata = await audioFileScanner.scanTrackNumbers(audiobook)
res.json(scandata)
}
async syncUserAudiobookData(req, res) {
if (!req.body.data) {
return res.status(403).send('Invalid local user audiobook data')