1
0
mirror of https://github.com/immich-app/immich.git synced 2025-01-26 17:21:29 +02:00

chore: cleanup template variables (#2107)

This commit is contained in:
Jason Rasmussen 2023-03-28 15:27:36 -04:00 committed by GitHub
parent 117f2fa00d
commit 3497a0de54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -133,11 +133,10 @@ export class StorageTemplateCore {
const substitutions: Record<string, string> = {
filename,
ext,
filetype: asset.type == AssetType.IMAGE ? 'IMG' : 'VID',
filetypefull: asset.type == AssetType.IMAGE ? 'IMAGE' : 'VIDEO',
};
const fileType = asset.type == AssetType.IMAGE ? 'IMG' : 'VID';
const fileTypeFull = asset.type == AssetType.IMAGE ? 'IMAGE' : 'VIDEO';
const dt = luxon.DateTime.fromISO(new Date(asset.fileCreatedAt).toISOString());
const dateTokens = [
@ -153,10 +152,6 @@ export class StorageTemplateCore {
substitutions[token] = dt.toFormat(token);
}
// Support file type token
substitutions.filetype = fileType;
substitutions.filetypefull = fileTypeFull;
return template(substitutions);
}
}