Skip to content

Commit

Permalink
Fix: Assign metadata to an actual object
Browse files Browse the repository at this point in the history
  • Loading branch information
stormwarning committed Oct 23, 2022
1 parent 6e029b6 commit ba237fb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/polite-buckets-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tidaltheory/lens': patch
---

Fix recording of metadata
11 changes: 8 additions & 3 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ import sharp from 'sharp'
import { IptcParser } from 'ts-node-iptc'
import { PackageJson } from 'type-fest'

import { ImageMeta, ImageRecord, ImageThumbnails } from '../types/types.js'
import {
ImageMeta,
ImageRecord,
ImageThumbnails,
LensConfig,
} from '../types/types.js'

import { loadConfig } from './lib/context.js'
import { getDominantPalette } from './lib/dominant.js'
Expand Down Expand Up @@ -52,7 +57,7 @@ prog.command('add <src>')
)
.action(async (source: string, options: Options) => {
let spinner = ora().start()
let config = await loadConfig()
let config: LensConfig = await loadConfig()
let useFilenameDirectory =
options.useFilenameDirectory || config.useFilenameDirectory

Expand Down Expand Up @@ -159,7 +164,7 @@ prog.command('add <src>')
}
}

let entryMeta: ImageMeta
let entryMeta: ImageMeta = {}
if (config.includeMetadata) {
entryMeta.title = iptcData.object_name
entryMeta.caption = iptcData.caption
Expand Down

0 comments on commit ba237fb

Please sign in to comment.