mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-03 09:44:41 +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
|
@ -66,7 +66,7 @@ class Scanner {
|
|||
}
|
||||
|
||||
async scanLibraryItemByRequest(libraryItem) {
|
||||
const library = Database.libraries.find(lib => lib.id === libraryItem.libraryId)
|
||||
const library = await Database.models.library.getOldById(libraryItem.libraryId)
|
||||
if (!library) {
|
||||
Logger.error(`[Scanner] Scan libraryItem by id library not found "${libraryItem.libraryId}"`)
|
||||
return ScanResult.NOTHING
|
||||
|
@ -552,7 +552,7 @@ class Scanner {
|
|||
|
||||
for (const folderId in folderGroups) {
|
||||
const libraryId = folderGroups[folderId].libraryId
|
||||
const library = Database.libraries.find(lib => lib.id === libraryId)
|
||||
const library = await Database.models.library.getOldById(libraryId)
|
||||
if (!library) {
|
||||
Logger.error(`[Scanner] Library not found in files changed ${libraryId}`)
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue