1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00

Merge pull request #860 from martyone/xmp-no-rating

Deal with rating missing in XMP sidecars
This commit is contained in:
Patrik J. Braun 2024-03-24 21:34:20 +01:00 committed by GitHub
commit d0c59244ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 4 deletions

View File

@ -175,7 +175,10 @@ export class MetadataLoader {
delete (sidecarData as any)['xap']; delete (sidecarData as any)['xap'];
} }
if ((sidecarData as SideCar).xmp !== undefined) { 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; metadata.rating = (sidecarData as SideCar).xmp.Rating;
} }
if ( if (
@ -651,7 +654,10 @@ export class MetadataLoader {
delete (sidecarData as any)['xap']; delete (sidecarData as any)['xap'];
} }
if ((sidecarData as SideCar).xmp !== undefined) { 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; metadata.rating = (sidecarData as SideCar).xmp.Rating;
} }
if ( if (

View File

@ -10,6 +10,5 @@
"book", "book",
"first", "first",
"second" "second"
], ]
"rating": 0
} }