Merge pull request #3107 from taxilian/bug/oldLibraryItemNull

bug: if oldLibraryItem is null things crash
This commit is contained in:
advplyr 2024-06-27 16:36:29 -05:00 committed by GitHub
commit 599623570b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)