Update new library scanner to handle metadata file changes

This commit is contained in:
advplyr 2023-09-03 15:14:58 -05:00
parent 9123dcb365
commit e63aab95d8
6 changed files with 265 additions and 69 deletions

View file

@ -153,7 +153,6 @@ class LibraryScanner {
if (libraryItemData.hasLibraryFileChanges || libraryItemData.hasPathChange) {
const libraryItem = await this.rescanLibraryItem(existingLibraryItem, libraryItemData, libraryScan)
const oldLibraryItem = Database.libraryItemModel.getOldLibraryItem(libraryItem)
await oldLibraryItem.saveMetadata() // Save metadata.json
oldLibraryItemsUpdated.push(oldLibraryItem)
} else {
// TODO: Temporary while using old model to socket emit
@ -264,7 +263,6 @@ class LibraryScanner {
const newLibraryItem = await this.scanNewLibraryItem(libraryItemData, libraryScan)
if (newLibraryItem) {
const oldLibraryItem = Database.libraryItemModel.getOldLibraryItem(newLibraryItem)
await oldLibraryItem.saveMetadata() // Save metadata.json
newOldLibraryItems.push(oldLibraryItem)
libraryScan.resultsAdded++