mirror of
https://github.com/KevinMidboe/immich.git
synced 2026-01-20 08:06:35 +00:00
refactor(server): download assets (#3032)
* refactor: download assets * chore: open api * chore: finish tests, make size configurable * chore: defualt to 4GiB * chore: open api * fix: optional archive size * fix: bugs * chore: cleanup
This commit is contained in:
31
server/src/domain/asset/dto/download.dto.ts
Normal file
31
server/src/domain/asset/dto/download.dto.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { ValidateUUID } from '@app/immich/decorators/validate-uuid.decorator';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsInt, IsOptional, IsPositive } from 'class-validator';
|
||||
|
||||
export class DownloadDto {
|
||||
@ValidateUUID({ each: true, optional: true })
|
||||
assetIds?: string[];
|
||||
|
||||
@ValidateUUID({ optional: true })
|
||||
albumId?: string;
|
||||
|
||||
@ValidateUUID({ optional: true })
|
||||
userId?: string;
|
||||
|
||||
@IsInt()
|
||||
@IsPositive()
|
||||
@IsOptional()
|
||||
archiveSize?: number;
|
||||
}
|
||||
|
||||
export class DownloadResponseDto {
|
||||
@ApiProperty({ type: 'integer' })
|
||||
totalSize!: number;
|
||||
archives!: DownloadArchiveInfo[];
|
||||
}
|
||||
|
||||
export class DownloadArchiveInfo {
|
||||
@ApiProperty({ type: 'integer' })
|
||||
size!: number;
|
||||
assetIds!: string[];
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
export * from './asset-ids.dto';
|
||||
export * from './download.dto';
|
||||
export * from './map-marker.dto';
|
||||
export * from './memory-lane.dto';
|
||||
|
||||
Reference in New Issue
Block a user