Skip to content

High performance self-hosted photo and video management solution.

feat(web): include timestamp in download filename (#5878)

Mohamed BOUSSAID4eca2b0f34ab
diff --git a/web/src/lib/components/shared-components/upload-panel.svelte b/web/src/lib/components/shared-components/upload-panel.svelte
index fd245a747d..6aa90b6a7f 100644
--- a/web/src/lib/components/shared-components/upload-panel.svelte
+++ b/web/src/lib/components/shared-components/upload-panel.svelte
@@ -44,7 +44,7 @@
if ($duplicateCounter > 0) {
notificationController.show({
- message: `Skipped ${$duplicateCounter} duplicate picture${$duplicateCounter > 1 ? 's' : ''}`,
+ message: `Skipped ${$duplicateCounter} duplicate asset${$duplicateCounter > 1 ? 's' : ''}`,
type: NotificationType.Warning,
});
}
diff --git a/web/src/lib/utils/asset-utils.ts b/web/src/lib/utils/asset-utils.ts
index 9a5c398f4c..a060e1a7f8 100644
--- a/web/src/lib/utils/asset-utils.ts
+++ b/web/src/lib/utils/asset-utils.ts
@@ -10,6 +10,7 @@ import {
type UserResponseDto,
} from '@api';
import { handleError } from './handle-error';
+import { DateTime } from 'luxon';
export const addAssetsToAlbum = async (albumId: string, assetIds: Array<string>): Promise<BulkIdResponseDto[]> =>
api.albumApi
@@ -59,7 +60,7 @@ export const downloadArchive = async (fileName: string, options: DownloadInfoDto
for (let i = 0; i < downloadInfo.archives.length; i++) {
const archive = downloadInfo.archives[i];
const suffix = downloadInfo.archives.length === 1 ? '' : `+${i + 1}`;
- const archiveName = fileName.replace('.zip', `${suffix}.zip`);
+ const archiveName = fileName.replace('.zip', `${suffix}-${DateTime.now().toFormat('yyyy-LL-dd-HH-mm-ss')}.zip`);
let downloadKey = `${archiveName} `;
if (downloadInfo.archives.length > 1) {