Skip to content

Commit

Permalink
feat(server): Storage template support album condition ([Request](#11999
Browse files Browse the repository at this point in the history
))
  • Loading branch information
feyst committed Aug 25, 2024
1 parent 7fbf50a commit 14d749b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/src/services/storage-template.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ export class StorageTemplateService {
filetypefull: asset.type == AssetType.IMAGE ? 'IMAGE' : 'VIDEO',
assetId: asset.id,
//just throw into the root if it doesn't belong to an album
album: (albumName && sanitize(albumName.replaceAll(/\.+/g, ''))) || '.',
album: (albumName && sanitize(albumName.replaceAll(/\.+/g, ''))) || '',
};

const systemTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
Expand All @@ -329,6 +329,6 @@ export class StorageTemplateService {
substitutions[token] = dt.toFormat(token);
}

return template(substitutions);
return template(substitutions).replaceAll(/\/{2,}/gm, '/');
}
}

0 comments on commit 14d749b

Please sign in to comment.