diff --git a/src/backend/model/fileaccess/MetadataLoader.ts b/src/backend/model/fileaccess/MetadataLoader.ts index d597b6d4..e0fcb50f 100644 --- a/src/backend/model/fileaccess/MetadataLoader.ts +++ b/src/backend/model/fileaccess/MetadataLoader.ts @@ -175,7 +175,10 @@ export class MetadataLoader { delete (sidecarData as any)['xap']; } if ((sidecarData as SideCar).xmp !== undefined) { - if ((sidecarData as SideCar).xmp.Rating !== undefined) { + if ( + (sidecarData as SideCar).xmp.Rating !== undefined && + (sidecarData as SideCar).xmp.Rating > 0 + ) { metadata.rating = (sidecarData as SideCar).xmp.Rating; } if ( @@ -651,7 +654,10 @@ export class MetadataLoader { delete (sidecarData as any)['xap']; } if ((sidecarData as SideCar).xmp !== undefined) { - if ((sidecarData as SideCar).xmp.Rating !== undefined) { + if ( + (sidecarData as SideCar).xmp.Rating !== undefined && + (sidecarData as SideCar).xmp.Rating > 0 + ) { metadata.rating = (sidecarData as SideCar).xmp.Rating; } if ( diff --git a/test/backend/assets/sidecar/metadata_v2.json b/test/backend/assets/sidecar/metadata_v2.json index e66ce699..36a37353 100644 --- a/test/backend/assets/sidecar/metadata_v2.json +++ b/test/backend/assets/sidecar/metadata_v2.json @@ -10,6 +10,5 @@ "book", "first", "second" - ], - "rating": 0 + ] }