mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-22 00:07:52 +01:00
Merge pull request #3107 from taxilian/bug/oldLibraryItemNull
bug: if oldLibraryItem is null things crash
This commit is contained in:
commit
599623570b
@ -176,11 +176,13 @@ class LibraryScanner {
|
|||||||
|
|
||||||
// TODO: Temporary while using old model to socket emit
|
// TODO: Temporary while using old model to socket emit
|
||||||
const oldLibraryItem = await Database.libraryItemModel.getOldById(existingLibraryItem.id)
|
const oldLibraryItem = await Database.libraryItemModel.getOldById(existingLibraryItem.id)
|
||||||
|
if (oldLibraryItem) {
|
||||||
oldLibraryItem.isMissing = true
|
oldLibraryItem.isMissing = true
|
||||||
oldLibraryItem.updatedAt = Date.now()
|
oldLibraryItem.updatedAt = Date.now()
|
||||||
oldLibraryItemsUpdated.push(oldLibraryItem)
|
oldLibraryItemsUpdated.push(oldLibraryItem)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
libraryItemDataFound = libraryItemDataFound.filter(lidf => lidf !== libraryItemData)
|
libraryItemDataFound = libraryItemDataFound.filter(lidf => lidf !== libraryItemData)
|
||||||
let libraryItemDataUpdated = await libraryItemData.checkLibraryItemData(existingLibraryItem, libraryScan)
|
let libraryItemDataUpdated = await libraryItemData.checkLibraryItemData(existingLibraryItem, libraryScan)
|
||||||
|
Loading…
Reference in New Issue
Block a user