Update libraryItem model to include libraryId

This commit is contained in:
advplyr 2023-03-21 17:06:08 -05:00
parent d745e6b656
commit 633e83a4ab
7 changed files with 161 additions and 4 deletions

View file

@ -601,6 +601,11 @@ function migrateLibraryItems(oldLibraryItems) {
Logger.error(`[dbMigration] migrateLibraryItems: Old library folder id not found "${oldLibraryItem.folderId}"`)
continue
}
const libraryId = oldDbIdMap.libraries[oldLibraryItem.libraryId]
if (!libraryId) {
Logger.error(`[dbMigration] migrateLibraryItems: Old library id not found "${oldLibraryItem.libraryId}"`)
continue
}
//
// Migrate LibraryItem
@ -622,6 +627,7 @@ function migrateLibraryItems(oldLibraryItems) {
lastScanVersion: oldLibraryItem.scanVersion,
createdAt: oldLibraryItem.addedAt,
updatedAt: oldLibraryItem.updatedAt,
libraryId,
libraryFolderId
}
oldDbIdMap.libraryItems[oldLibraryItem.id] = LibraryItem.id