mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-09 07:14:52 +02:00
Update:Only load libraries from db when needed
This commit is contained in:
@ -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({
|
||||
|
Reference in New Issue
Block a user