Skip to content

Commit

Permalink
import rating
Browse files Browse the repository at this point in the history
  • Loading branch information
pacoccino committed Mar 2, 2022
1 parent d957b0f commit cf8e667
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions api/src/lib/images/metadata_parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export type ImageParsedMetadata = {
software?: string
}
keywords?: string[]
rating?: number
}

function getProp(
Expand Down Expand Up @@ -64,6 +65,12 @@ export function parseMetadata_exifr(
}
}

// rating
const rating = getProp(rawMD, ['xmp.Rating'])
if (rating) {
parsed.rating = rating
}

// keywords
const keywords = getProp(rawMD, ['iptc.Keywords'])
if (keywords) {
Expand Down
1 change: 1 addition & 0 deletions api/src/lib/importer/importFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export const getImportWorker = ({ logger, prefix, rootDir }) =>
path: s3path,
dateTaken: imageMetadata.parsed.date.capture,
metadata: imageMetadata.raw,
rating: imageMetadata.parsed.rating,
},
})

Expand Down
1 change: 1 addition & 0 deletions web/src/components/Image/ImageCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const QUERY = gql`
path
dateTaken
metadata
rating
tagsOnImages {
id
tag {
Expand Down

0 comments on commit cf8e667

Please sign in to comment.