Change:Series volume numbers to use language sensitive sorting #261

This commit is contained in:
advplyr 2021-12-26 11:25:07 -06:00
parent 49fcaefd01
commit ef94a6bb29
4 changed files with 45 additions and 31 deletions

View file

@ -15,6 +15,7 @@ const BackupController = require('./controllers/BackupController')
const BookFinder = require('./BookFinder')
const AuthorFinder = require('./AuthorFinder')
const FileSystemController = require('./controllers/FileSystemController')
class ApiController {
constructor(MetadataPath, db, auth, streamManager, rssFeeds, downloadManager, coverController, backupManager, watcher, cacheManager, emitter, clientEmitter) {
@ -145,6 +146,11 @@ class ApiController {
this.router.get('/search/covers', this.findCovers.bind(this))
this.router.get('/search/books', this.findBooks.bind(this))
//
// File System Routes
//
this.router.get('/filesystem', FileSystemController.getPaths.bind(this))
//
// Others
//
@ -163,8 +169,6 @@ class ApiController {
this.router.get('/download/:id', this.download.bind(this))
this.router.get('/filesystem', this.getFileSystemPaths.bind(this))
this.router.post('/syncUserAudiobookData', this.syncUserAudiobookData.bind(this))
this.router.post('/purgecache', this.purgeCache.bind(this))
@ -339,25 +343,6 @@ class ApiController {
}
}
async getFileSystemPaths(req, res) {
var excludedDirs = ['node_modules', 'client', 'server', '.git', 'static', 'build', 'dist', 'metadata', 'config', 'sys', 'proc'].map(dirname => {
return Path.sep + dirname
})
// Do not include existing mapped library paths in response
this.db.libraries.forEach(lib => {
lib.folders.forEach((folder) => {
var dir = folder.fullPath
if (dir.includes(global.appRoot)) dir = dir.replace(global.appRoot, '')
excludedDirs.push(dir)
})
})
Logger.debug(`[Server] get file system paths, excluded: ${excludedDirs.join(', ')}`)
var dirs = await this.getDirectories(global.appRoot, '/', excludedDirs)
res.json(dirs)
}
async syncUserAudiobookData(req, res) {
if (!req.body.data) {
return res.status(403).send('Invalid local user audiobook data')