1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2024-12-23 01:27:14 +02:00

fix bug 1 of #838 : If the tagged video contains only one keyword, the keyword is shown in PiGallery2 character by character, each prefixed by a hash sign, all separated by comma and space

This commit is contained in:
kagahd 2024-02-26 21:37:28 +01:00
parent d1684d4c89
commit 75e4ed70b6
No known key found for this signature in database
GPG Key ID: C7C8777FDE0053DF

View File

@ -144,11 +144,16 @@ export class MetadataLoader {
if (metadata.keywords === undefined) {
metadata.keywords = [];
}
for (const kw of (sidecarData as SideCar).dc.subject) {
let keywords = (sidecarData as SideCar).dc.subject || [];
if (typeof keywords === 'string') {
keywords = [keywords];
}
for (const kw of keywords) {
if (metadata.keywords.indexOf(kw) === -1) {
metadata.keywords.push(kw);
}
} }
}
}
if ((sidecarData as SideCar).xmp.Rating !== undefined) {
metadata.rating = (sidecarData as SideCar).xmp.Rating;
}
@ -536,7 +541,11 @@ export class MetadataLoader {
if (metadata.keywords === undefined) {
metadata.keywords = [];
}
for (const kw of (sidecarData as SideCar).dc.subject) {
let keywords = (sidecarData as SideCar).dc.subject || [];
if (typeof keywords === 'string') {
keywords = [keywords];
}
for (const kw of keywords) {
if (metadata.keywords.indexOf(kw) === -1) {
metadata.keywords.push(kw);
}