mirror of
				https://github.com/immich-app/immich.git
				synced 2025-11-03 19:29:32 -05: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:
		
							parent
							
								
									64e299ba9b
								
							
						
					
					
						commit
						4eca2b0f34
					
				@ -44,7 +44,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
      if ($duplicateCounter > 0) {
 | 
					      if ($duplicateCounter > 0) {
 | 
				
			||||||
        notificationController.show({
 | 
					        notificationController.show({
 | 
				
			||||||
          message: `Skipped ${$duplicateCounter} duplicate picture${$duplicateCounter > 1 ? 's' : ''}`,
 | 
					          message: `Skipped ${$duplicateCounter} duplicate asset${$duplicateCounter > 1 ? 's' : ''}`,
 | 
				
			||||||
          type: NotificationType.Warning,
 | 
					          type: NotificationType.Warning,
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
				
			|||||||
@ -10,6 +10,7 @@ import {
 | 
				
			|||||||
  type UserResponseDto,
 | 
					  type UserResponseDto,
 | 
				
			||||||
} from '@api';
 | 
					} from '@api';
 | 
				
			||||||
import { handleError } from './handle-error';
 | 
					import { handleError } from './handle-error';
 | 
				
			||||||
 | 
					import { DateTime } from 'luxon';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const addAssetsToAlbum = async (albumId: string, assetIds: Array<string>): Promise<BulkIdResponseDto[]> =>
 | 
					export const addAssetsToAlbum = async (albumId: string, assetIds: Array<string>): Promise<BulkIdResponseDto[]> =>
 | 
				
			||||||
  api.albumApi
 | 
					  api.albumApi
 | 
				
			||||||
@ -59,7 +60,7 @@ export const downloadArchive = async (fileName: string, options: DownloadInfoDto
 | 
				
			|||||||
  for (let i = 0; i < downloadInfo.archives.length; i++) {
 | 
					  for (let i = 0; i < downloadInfo.archives.length; i++) {
 | 
				
			||||||
    const archive = downloadInfo.archives[i];
 | 
					    const archive = downloadInfo.archives[i];
 | 
				
			||||||
    const suffix = downloadInfo.archives.length === 1 ? '' : `+${i + 1}`;
 | 
					    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} `;
 | 
					    let downloadKey = `${archiveName} `;
 | 
				
			||||||
    if (downloadInfo.archives.length > 1) {
 | 
					    if (downloadInfo.archives.length > 1) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user