Library scanner saves last scan info including metadata precedence. Remove force re-scan

This commit is contained in:
advplyr 2023-10-09 17:48:21 -05:00
parent f84634e978
commit c9a2fdcb29
4 changed files with 35 additions and 10 deletions

View file

@ -80,6 +80,9 @@ class Library extends Model {
mediaType: libraryExpanded.mediaType,
provider: libraryExpanded.provider,
settings: libraryExpanded.settings,
lastScan: libraryExpanded.lastScan?.valueOf() || null,
lastScanVersion: libraryExpanded.lastScanVersion || null,
lastScanMetadataPrecedence: libraryExpanded.extraData?.lastScanMetadataPrecedence || null,
createdAt: libraryExpanded.createdAt.valueOf(),
lastUpdate: libraryExpanded.updatedAt.valueOf()
})
@ -152,6 +155,9 @@ class Library extends Model {
if (oldLibrary.oldLibraryId) {
extraData.oldLibraryId = oldLibrary.oldLibraryId
}
if (oldLibrary.lastScanMetadataPrecedence) {
extraData.lastScanMetadataPrecedence = oldLibrary.lastScanMetadataPrecedence
}
return {
id: oldLibrary.id,
name: oldLibrary.name,
@ -160,6 +166,8 @@ class Library extends Model {
mediaType: oldLibrary.mediaType || null,
provider: oldLibrary.provider,
settings: oldLibrary.settings?.toJSON() || {},
lastScan: oldLibrary.lastScan || null,
lastScanVersion: oldLibrary.lastScanVersion || null,
createdAt: oldLibrary.createdAt,
updatedAt: oldLibrary.lastUpdate,
extraData