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:
Jason Rasmussen
2023-06-30 12:24:28 -04:00
committed by GitHub
parent df9c05bef3
commit ad343b7b32
53 changed files with 1455 additions and 1403 deletions

View 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[];
}

View File

@@ -1,3 +1,4 @@
export * from './asset-ids.dto';
export * from './download.dto';
export * from './map-marker.dto';
export * from './memory-lane.dto';