Fix folder browser, fix track number parsed from filename too large, add mp4 audiobook support

This commit is contained in:
advplyr 2021-10-10 19:29:22 -05:00
parent 04f92c33c2
commit 120c70622a
10 changed files with 26 additions and 12 deletions

View file

@ -692,7 +692,7 @@ class ApiController {
var path = Path.join(relpath, dirname)
var isDir = (await fs.lstat(fullPath)).isDirectory()
if (isDir && !excludedDirs.includes(dirname)) {
if (isDir && !excludedDirs.includes(path) && dirname !== 'node_modules') {
return {
path,
dirname,
@ -713,12 +713,16 @@ class ApiController {
}
async getFileSystemPaths(req, res) {
var excludedDirs = ['node_modules', 'client', 'server', '.git', 'static', 'build', 'dist', 'metadata', 'config', 'sys', 'proc']
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) => {
excludedDirs.push(Path.basename(folder.fullPath))
var dir = folder.fullPath
if (dir.includes(global.appRoot)) dir = dir.replace(global.appRoot, '')
excludedDirs.push(dir)
})
})