diff --git a/demo/images/IMG_5910.jpg.xmp b/demo/images/IMG_5910.jpg.xmp index 8ca2fac0..0043a4b1 100644 --- a/demo/images/IMG_5910.jpg.xmp +++ b/demo/images/IMG_5910.jpg.xmp @@ -356,7 +356,7 @@ Adobe Photoshop Lightroom 6.1 (Windows) 2023-09-02T16:18:48+02:00 2015-07-24T22:45:50 - 3 + 4 2018-11-17T20:27:31+01:00 2018-11-17T20:27:31+01:00 2018-11-17T20:27:31+01:00 + 4 { 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; }); } } diff --git a/src/common/entities/ConentWrapper.ts b/src/common/entities/ConentWrapper.ts index 5bd6e3e2..f0321575 100644 --- a/src/common/entities/ConentWrapper.ts +++ b/src/common/entities/ConentWrapper.ts @@ -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; diff --git a/src/common/entities/MediaDTO.ts b/src/common/entities/MediaDTO.ts index 0a1a3e79..b56136ca 100644 --- a/src/common/entities/MediaDTO.ts +++ b/src/common/entities/MediaDTO.ts @@ -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 { diff --git a/src/common/entities/PhotoDTO.ts b/src/common/entities/PhotoDTO.ts index f95a10e8..1bd6b090 100644 --- a/src/common/entities/PhotoDTO.ts +++ b/src/common/entities/PhotoDTO.ts @@ -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; diff --git a/src/common/entities/VideoDTO.ts b/src/common/entities/VideoDTO.ts index e726c625..d9cefefc 100644 --- a/src/common/entities/VideoDTO.ts +++ b/src/common/entities/VideoDTO.ts @@ -15,5 +15,4 @@ export interface VideoMetadata extends MediaMetadata { duration: number; // in milliseconds fileSize: number; fps: number; - keywords?: string[]; }