chore: rebase and clean-up

This commit is contained in:
Jason Rasmussen
2023-11-21 21:16:40 -05:00
parent c1d9ce8679
commit b8a9cbc659
31 changed files with 928 additions and 53 deletions
@@ -1,7 +1,7 @@
import { GeoPoint, IMetadataRepository, ImmichTags, ReverseGeocodeResult } from '@app/domain';
import { REVERSE_GEOCODING_DUMP_DIRECTORY } from '@app/infra';
import { Injectable, Logger } from '@nestjs/common';
import { DefaultReadTaskOptions, exiftool } from 'exiftool-vendored';
import { DefaultReadTaskOptions, Tags, exiftool } from 'exiftool-vendored';
import { readdir, rm } from 'fs/promises';
import * as geotz from 'geo-tz';
import { getName } from 'i18n-iso-countries';
@@ -76,7 +76,7 @@ export class MetadataRepository implements IMetadataRepository {
return { country, state, city };
}
getExifTags(path: string): Promise<ImmichTags | null> {
readTags(path: string): Promise<ImmichTags | null> {
return exiftool
.read(path, undefined, {
...DefaultReadTaskOptions,
@@ -93,4 +93,8 @@ export class MetadataRepository implements IMetadataRepository {
return null;
}) as Promise<ImmichTags | null>;
}
async writeTags(path: string, tags: Partial<Tags>): Promise<void> {
await exiftool.write(path, tags, ['-overwrite_original']);
}
}