Update:Only load libraries from db when needed

This commit is contained in:
advplyr 2023-07-22 14:25:20 -05:00
parent 1c40af3eef
commit 1d974375a0
13 changed files with 189 additions and 60 deletions

View file

@ -17,12 +17,11 @@ class FileSystemController {
})
// Do not include existing mapped library paths in response
Database.libraries.forEach(lib => {
lib.folders.forEach((folder) => {
let dir = folder.fullPath
if (dir.includes(global.appRoot)) dir = dir.replace(global.appRoot, '')
excludedDirs.push(dir)
})
const libraryFoldersPaths = await Database.models.libraryFolder.getAllLibraryFolderPaths()
libraryFoldersPaths.forEach((path) => {
let dir = path || ''
if (dir.includes(global.appRoot)) dir = dir.replace(global.appRoot, '')
excludedDirs.push(dir)
})
res.json({