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

Merge remote-tracking branch 'origin/master'

This commit is contained in:
Patrik J. Braun 2023-11-26 22:48:09 +01:00
commit ed811a051d
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:CreatorTool>Adobe Photoshop Lightroom 6.1 (Windows)</xmp:CreatorTool>
<xmp:MetadataDate>2023-09-02T16:18:48+02:00</xmp:MetadataDate> <xmp:MetadataDate>2023-09-02T16:18:48+02:00</xmp:MetadataDate>
<xmp:ModifyDate>2015-07-24T22:45:50</xmp:ModifyDate> <xmp:ModifyDate>2015-07-24T22:45:50</xmp:ModifyDate>
<xmp:Rating>3</xmp:Rating> <xmp:Rating>4</xmp:Rating>
</rdf:Description> </rdf:Description>
<rdf:Description rdf:about='' <rdf:Description rdf:about=''

View File

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

View File

@ -51,6 +51,7 @@ export class MetadataLoader {
const sidecarData = exifr.sidecar(sidecarPath); const sidecarData = exifr.sidecar(sidecarPath);
sidecarData.then((response) => { sidecarData.then((response) => {
metadata.keywords = [(response as any).dc.subject].flat(); 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); const sidecarData = exifr.sidecar(sidecarPath);
sidecarData.then((response) => { sidecarData.then((response) => {
metadata.keywords = [(response as any).dc.subject].flat(); 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); ContentWrapper.mapify(cw, m, isSearchResult);
} else if (MediaDTOUtils.isVideo(m)) { } else if (MediaDTOUtils.isVideo(m)) {
delete (m as PhotoDTO).metadata.rating;
delete (m as PhotoDTO).metadata.caption; delete (m as PhotoDTO).metadata.caption;
delete (m as PhotoDTO).metadata.cameraData; delete (m as PhotoDTO).metadata.cameraData;
delete (m as PhotoDTO).metadata.faces; delete (m as PhotoDTO).metadata.faces;

View File

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

View File

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

View File

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