mirror of
https://github.com/bpatrik/pigallery2.git
synced 2024-12-23 01:27:14 +02:00
Deal with rating missing in XMP sidecars
Avoid getting Rating of 0 when rating metadata is not included in a sidecar.
This commit is contained in:
parent
e3a0f5967c
commit
8517430a1b
@ -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 (
|
||||
|
@ -10,6 +10,5 @@
|
||||
"book",
|
||||
"first",
|
||||
"second"
|
||||
],
|
||||
"rating": 0
|
||||
]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user