Skip to content

Commit

Permalink
Formater + try/catch error
Browse files Browse the repository at this point in the history
  • Loading branch information
YFrendo committed Nov 29, 2023
1 parent 5d4d04f commit 493cf93
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
9 changes: 5 additions & 4 deletions server/src/infra/repositories/metadata.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,10 @@ export class MetadataRepository implements IMetadataRepository {

async writeTags(path: string, tags: Partial<Tags>): Promise<void> {

await exiftool.write(path, tags, ['-overwrite_original']).catch((error) => {
this.logger.warn(`Error writing exif data (${path}): ${error}`, error?.stack);
return null;
});
try {
await exiftool.write(path, tags, ['-overwrite_original']);
} catch (error) {
this.logger.warn(`Error writing exif data (${path}): ${error}`);
}
}
}
15 changes: 6 additions & 9 deletions web/src/lib/components/asset-viewer/detail-panel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,7 @@
</button>
</div>
{:else if !asset.exifInfo?.dateTimeOriginal && !asset.isReadOnly}
<div
class="flex justify-between place-items-start gap-4 py-4">
<div class="flex justify-between place-items-start gap-4 py-4">
<div class="flex gap-4">
<div>
<Icon path={mdiCalendar} size="24" />
Expand All @@ -293,10 +292,10 @@
</button>
</div>
{:else if asset.exifInfo?.dateTimeOriginal && asset.isReadOnly}
{@const assetDateTimeOriginal = DateTime.fromISO(asset.exifInfo.dateTimeOriginal, {
zone: asset.exifInfo.timeZone ?? undefined,
})}
<div class="flex justify-between place-items-start gap-4 py-4">
{@const assetDateTimeOriginal = DateTime.fromISO(asset.exifInfo.dateTimeOriginal, {
zone: asset.exifInfo.timeZone ?? undefined,
})}
<div class="flex justify-between place-items-start gap-4 py-4">
<div class="flex gap-4">
<div>
<Icon path={mdiCalendar} size="24" />
Expand Down Expand Up @@ -329,7 +328,6 @@
</div>
</div>
</div>

{/if}

{#if isShowChangeDate}
Expand Down Expand Up @@ -462,8 +460,7 @@
</div>
</div>
{:else if asset.exifInfo?.city && asset.isReadOnly}
<div
class="flex justify-between place-items-start gap-4 py-4">
<div class="flex justify-between place-items-start gap-4 py-4">
<div class="flex gap-4">
<div><Icon path={mdiMapMarkerOutline} size="24" /></div>

Expand Down

0 comments on commit 493cf93

Please sign in to comment.