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

Merge pull request #773 from grahamalderson/xmp-sidecar-support

Added ratings to xmp sidecar support
This commit is contained in:
Patrik J. Braun 2023-11-26 11:03:03 +01:00 committed by GitHub
commit 9514b3d803
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 8 additions and 5 deletions

View File

@ -356,7 +356,7 @@
<xmp:CreatorTool>Adobe Photoshop Lightroom 6.1 (Windows)</xmp:CreatorTool>
<xmp:MetadataDate>2023-09-02T16:18:48+02:00</xmp:MetadataDate>
<xmp:ModifyDate>2015-07-24T22:45:50</xmp:ModifyDate>
<xmp:Rating>3</xmp:Rating>
<xmp:Rating>4</xmp:Rating>
</rdf:Description>
<rdf:Description rdf:about=''

View File

@ -36,6 +36,7 @@
<xmp:CreateDate>2018-11-17T20:27:31+01:00</xmp:CreateDate>
<xmp:MetadataDate>2018-11-17T20:27:31+01:00</xmp:MetadataDate>
<xmp:ModifyDate>2018-11-17T20:27:31+01:00</xmp:ModifyDate>
<xmp:Rating>4</xmp:Rating>
</rdf:Description>
<rdf:Description rdf:about=''

View File

@ -51,6 +51,7 @@ export class MetadataLoader {
const sidecarData = exifr.sidecar(sidecarPath);
sidecarData.then((response) => {
metadata.keywords = [(response as any).dc.subject].flat();
metadata.rating = (response as any).xmp.Rating;
});
}
}
@ -199,6 +200,7 @@ export class MetadataLoader {
const sidecarData = exifr.sidecar(sidecarPath);
sidecarData.then((response) => {
metadata.keywords = [(response as any).dc.subject].flat();
metadata.rating = (response as any).xmp.Rating;
});
}
}

View File

@ -238,7 +238,6 @@ export class ContentWrapper {
}
ContentWrapper.mapify(cw, m, isSearchResult);
} else if (MediaDTOUtils.isVideo(m)) {
delete (m as PhotoDTO).metadata.rating;
delete (m as PhotoDTO).metadata.caption;
delete (m as PhotoDTO).metadata.cameraData;
delete (m as PhotoDTO).metadata.faces;

View File

@ -11,10 +11,14 @@ export interface MediaDTO extends FileDTO {
missingThumbnails?: number;
}
export type RatingTypes = 0 | 1 | 2 | 3 | 4 | 5;
export interface MediaMetadata {
size: MediaDimension;
creationDate: number;
fileSize: number;
keywords?: string[];
rating?: RatingTypes;
}
export interface MediaDimension {

View File

@ -27,9 +27,7 @@ export interface FaceRegion {
}
export interface PhotoMetadata extends MediaMetadata {
rating?: 0 | 1 | 2 | 3 | 4 | 5;
caption?: string;
keywords?: string[];
cameraData?: CameraMetadata;
positionData?: PositionMetaData;
size: MediaDimension;

View File

@ -15,5 +15,4 @@ export interface VideoMetadata extends MediaMetadata {
duration: number; // in milliseconds
fileSize: number;
fps: number;
keywords?: string[];
}