edit-meta: missing key

Signed-off-by: Varun Patil <radialapps@gmail.com>
pulsejet/aio-hw-docs
Varun Patil 2023-11-14 09:00:25 -08:00
parent 379184247f
commit 509f797ffb
1 changed files with 3 additions and 6 deletions

View File

@ -244,9 +244,7 @@ export default defineComponent({
if ( if (
this.photos!.some( this.photos!.some(
(p) => (p) =>
!p.imageInfo?.exif?.DateTimeOriginal && !p.imageInfo?.exif?.DateTimeOriginal && !p.imageInfo?.exif?.CreateDate && !exifs.get(p.fileid)!.AllDates,
!p.imageInfo?.exif?.CreateDate &&
!exifs.get(p.fileid)!.DateTimeOriginal,
) && ) &&
(await utils.confirmDestructive({ (await utils.confirmDestructive({
title: this.t('memories', 'Missing date metadata'), title: this.t('memories', 'Missing date metadata'),
@ -259,12 +257,11 @@ export default defineComponent({
for (const p of this.photos!) { for (const p of this.photos!) {
// Check if we need / can update the date for this file // Check if we need / can update the date for this file
const raw = exifs.get(p.fileid)!; const raw = exifs.get(p.fileid)!;
if (!p.datetaken || raw.DateTimeOriginal) continue; if (!p.datetaken || raw.AllDates) continue;
// Get the date in EXIF format // Get the date in EXIF format
const dateTaken = utils.getExifDateStr(new Date(p.datetaken * 1000)); const dateTaken = utils.getExifDateStr(new Date(p.datetaken * 1000));
raw.DateTimeOriginal = dateTaken; raw.AllDates = dateTaken;
raw.CreateDate = dateTaken;
} }
} }