mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-06-21 08:36:03 +02:00
Update:Only load libraries from db when needed
This commit is contained in:
parent
1c40af3eef
commit
1d974375a0
13 changed files with 189 additions and 60 deletions
|
@ -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({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue