Files
immich/server/src/dtos/download.dto.ts
T
Jorge Montejo 1f8359ead4 fix: Download the edited version when downloading multiple photos (#26259)
* fix: download the edited version when downloading multiple photos

* test: update tests

* chore: clean up

---------

Co-authored-by: Jason Rasmussen <jason@rasm.me>
2026-02-18 21:47:45 +00:00

41 lines
1.3 KiB
TypeScript

import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { IsInt, IsPositive } from 'class-validator';
import { AssetIdsDto } from 'src/dtos/asset.dto';
import { Optional, ValidateBoolean, ValidateUUID } from 'src/validation';
export class DownloadInfoDto {
@ValidateUUID({ each: true, optional: true, description: 'Asset IDs to download' })
assetIds?: string[];
@ValidateUUID({ optional: true, description: 'Album ID to download' })
albumId?: string;
@ValidateUUID({ optional: true, description: 'User ID to download assets from' })
userId?: string;
@ApiPropertyOptional({ type: 'integer', description: 'Archive size limit in bytes' })
@IsInt()
@IsPositive()
@Optional()
archiveSize?: number;
}
export class DownloadResponseDto {
@ApiProperty({ type: 'integer', description: 'Total size in bytes' })
totalSize!: number;
@ApiProperty({ description: 'Archive information' })
archives!: DownloadArchiveInfo[];
}
export class DownloadArchiveInfo {
@ApiProperty({ type: 'integer', description: 'Archive size in bytes' })
size!: number;
@ApiProperty({ description: 'Asset IDs in this archive' })
assetIds!: string[];
}
export class DownloadArchiveDto extends AssetIdsDto {
@ValidateBoolean({ optional: true, description: 'Download edited asset if available' })
edited?: boolean;
}