1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2024-12-29 15:11:58 +00:00

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

* Blocking multiple downloads

* Blocking the download based on file name and not download type

* Fixing failing workflow

* Make sure the uniqueDownloadId is unique even if the selecting order is different

* Using DateTime from luxon & convering the case of downloading an album

* Fixing typo in the warning.

* Covering the case where tha list of assets is to big

* Fix format

* Fix format

* Fix format

* Undo block multi-downloads

* Running format:fix

---------

Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
Mohamed BOUSSAID 2024-01-25 18:14:02 +01:00 committed by GitHub
parent 64e299ba9b
commit 4eca2b0f34
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View file

@ -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,
});
}

View file

@ -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) {