diff --git a/cli/src/api/open-api/api.ts b/cli/src/api/open-api/api.ts index 956f19ba7..8ade1d5fd 100644 --- a/cli/src/api/open-api/api.ts +++ b/cli/src/api/open-api/api.ts @@ -1132,6 +1132,37 @@ export interface DownloadArchiveInfo { */ 'size': number; } +/** + * + * @export + * @interface DownloadInfoDto + */ +export interface DownloadInfoDto { + /** + * + * @type {string} + * @memberof DownloadInfoDto + */ + 'albumId'?: string; + /** + * + * @type {number} + * @memberof DownloadInfoDto + */ + 'archiveSize'?: number; + /** + * + * @type {Array} + * @memberof DownloadInfoDto + */ + 'assetIds'?: Array; + /** + * + * @type {string} + * @memberof DownloadInfoDto + */ + 'userId'?: string; +} /** * * @export @@ -4880,7 +4911,7 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration downloadArchive: async (assetIdsDto: AssetIdsDto, key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'assetIdsDto' is not null or undefined assertParamExists('downloadArchive', 'assetIdsDto', assetIdsDto) - const localVarPath = `/asset/download`; + const localVarPath = `/asset/download/archive`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -5379,16 +5410,15 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration }, /** * - * @param {Array} [assetIds] - * @param {string} [albumId] - * @param {string} [userId] - * @param {number} [archiveSize] + * @param {DownloadInfoDto} downloadInfoDto * @param {string} [key] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getDownloadInfo: async (assetIds?: Array, albumId?: string, userId?: string, archiveSize?: number, key?: string, options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/asset/download`; + getDownloadInfo: async (downloadInfoDto: DownloadInfoDto, key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'downloadInfoDto' is not null or undefined + assertParamExists('getDownloadInfo', 'downloadInfoDto', downloadInfoDto) + const localVarPath = `/asset/download/info`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -5396,7 +5426,7 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -5409,31 +5439,18 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) - if (assetIds) { - localVarQueryParameter['assetIds'] = assetIds; - } - - if (albumId !== undefined) { - localVarQueryParameter['albumId'] = albumId; - } - - if (userId !== undefined) { - localVarQueryParameter['userId'] = userId; - } - - if (archiveSize !== undefined) { - localVarQueryParameter['archiveSize'] = archiveSize; - } - if (key !== undefined) { localVarQueryParameter['key'] = key; } + localVarHeaderParameter['Content-Type'] = 'application/json'; + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(downloadInfoDto, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -6141,16 +6158,13 @@ export const AssetApiFp = function(configuration?: Configuration) { }, /** * - * @param {Array} [assetIds] - * @param {string} [albumId] - * @param {string} [userId] - * @param {number} [archiveSize] + * @param {DownloadInfoDto} downloadInfoDto * @param {string} [key] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getDownloadInfo(assetIds?: Array, albumId?: string, userId?: string, archiveSize?: number, key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getDownloadInfo(assetIds, albumId, userId, archiveSize, key, options); + async getDownloadInfo(downloadInfoDto: DownloadInfoDto, key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getDownloadInfo(downloadInfoDto, key, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -6406,8 +6420,8 @@ export const AssetApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getDownloadInfo(requestParameters: AssetApiGetDownloadInfoRequest = {}, options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.getDownloadInfo(requestParameters.assetIds, requestParameters.albumId, requestParameters.userId, requestParameters.archiveSize, requestParameters.key, options).then((request) => request(axios, basePath)); + getDownloadInfo(requestParameters: AssetApiGetDownloadInfoRequest, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.getDownloadInfo(requestParameters.downloadInfoDto, requestParameters.key, options).then((request) => request(axios, basePath)); }, /** * @@ -6788,31 +6802,10 @@ export interface AssetApiGetByTimeBucketRequest { export interface AssetApiGetDownloadInfoRequest { /** * - * @type {Array} + * @type {DownloadInfoDto} * @memberof AssetApiGetDownloadInfo */ - readonly assetIds?: Array - - /** - * - * @type {string} - * @memberof AssetApiGetDownloadInfo - */ - readonly albumId?: string - - /** - * - * @type {string} - * @memberof AssetApiGetDownloadInfo - */ - readonly userId?: string - - /** - * - * @type {number} - * @memberof AssetApiGetDownloadInfo - */ - readonly archiveSize?: number + readonly downloadInfoDto: DownloadInfoDto /** * @@ -7281,8 +7274,8 @@ export class AssetApi extends BaseAPI { * @throws {RequiredError} * @memberof AssetApi */ - public getDownloadInfo(requestParameters: AssetApiGetDownloadInfoRequest = {}, options?: AxiosRequestConfig) { - return AssetApiFp(this.configuration).getDownloadInfo(requestParameters.assetIds, requestParameters.albumId, requestParameters.userId, requestParameters.archiveSize, requestParameters.key, options).then((request) => request(this.axios, this.basePath)); + public getDownloadInfo(requestParameters: AssetApiGetDownloadInfoRequest, options?: AxiosRequestConfig) { + return AssetApiFp(this.configuration).getDownloadInfo(requestParameters.downloadInfoDto, requestParameters.key, options).then((request) => request(this.axios, this.basePath)); } /** diff --git a/mobile/openapi/.openapi-generator/FILES b/mobile/openapi/.openapi-generator/FILES index ea0993be8..bf485ef08 100644 --- a/mobile/openapi/.openapi-generator/FILES +++ b/mobile/openapi/.openapi-generator/FILES @@ -45,6 +45,7 @@ doc/DeleteAssetDto.md doc/DeleteAssetResponseDto.md doc/DeleteAssetStatus.md doc/DownloadArchiveInfo.md +doc/DownloadInfoDto.md doc/DownloadResponseDto.md doc/ExifResponseDto.md doc/ImportAssetDto.md @@ -186,6 +187,7 @@ lib/model/delete_asset_dto.dart lib/model/delete_asset_response_dto.dart lib/model/delete_asset_status.dart lib/model/download_archive_info.dart +lib/model/download_info_dto.dart lib/model/download_response_dto.dart lib/model/exif_response_dto.dart lib/model/import_asset_dto.dart @@ -298,6 +300,7 @@ test/delete_asset_dto_test.dart test/delete_asset_response_dto_test.dart test/delete_asset_status_test.dart test/download_archive_info_test.dart +test/download_info_dto_test.dart test/download_response_dto_test.dart test/exif_response_dto_test.dart test/import_asset_dto_test.dart diff --git a/mobile/openapi/README.md b/mobile/openapi/README.md index 1e20582fa..9167613b2 100644 Binary files a/mobile/openapi/README.md and b/mobile/openapi/README.md differ diff --git a/mobile/openapi/doc/AssetApi.md b/mobile/openapi/doc/AssetApi.md index 2999f2de2..5c1c7bb4b 100644 Binary files a/mobile/openapi/doc/AssetApi.md and b/mobile/openapi/doc/AssetApi.md differ diff --git a/mobile/openapi/doc/DownloadInfoDto.md b/mobile/openapi/doc/DownloadInfoDto.md new file mode 100644 index 000000000..14d5d1e71 Binary files /dev/null and b/mobile/openapi/doc/DownloadInfoDto.md differ diff --git a/mobile/openapi/lib/api.dart b/mobile/openapi/lib/api.dart index 644244a10..a38d8784e 100644 Binary files a/mobile/openapi/lib/api.dart and b/mobile/openapi/lib/api.dart differ diff --git a/mobile/openapi/lib/api/asset_api.dart b/mobile/openapi/lib/api/asset_api.dart index 6f4c391bf..ba9f1d5a1 100644 Binary files a/mobile/openapi/lib/api/asset_api.dart and b/mobile/openapi/lib/api/asset_api.dart differ diff --git a/mobile/openapi/lib/api_client.dart b/mobile/openapi/lib/api_client.dart index fd1252cc7..eb76c12c5 100644 Binary files a/mobile/openapi/lib/api_client.dart and b/mobile/openapi/lib/api_client.dart differ diff --git a/mobile/openapi/lib/model/download_info_dto.dart b/mobile/openapi/lib/model/download_info_dto.dart new file mode 100644 index 000000000..fa3a06eea Binary files /dev/null and b/mobile/openapi/lib/model/download_info_dto.dart differ diff --git a/mobile/openapi/test/asset_api_test.dart b/mobile/openapi/test/asset_api_test.dart index 588902a14..ebb472c4a 100644 Binary files a/mobile/openapi/test/asset_api_test.dart and b/mobile/openapi/test/asset_api_test.dart differ diff --git a/mobile/openapi/test/download_info_dto_test.dart b/mobile/openapi/test/download_info_dto_test.dart new file mode 100644 index 000000000..5efd4e11e Binary files /dev/null and b/mobile/openapi/test/download_info_dto_test.dart differ diff --git a/server/immich-openapi-specs.json b/server/immich-openapi-specs.json index 59543353f..f193eb25e 100644 --- a/server/immich-openapi-specs.json +++ b/server/immich-openapi-specs.json @@ -1026,84 +1026,7 @@ ] } }, - "/asset/download": { - "get": { - "operationId": "getDownloadInfo", - "parameters": [ - { - "name": "assetIds", - "required": false, - "in": "query", - "schema": { - "format": "uuid", - "type": "array", - "items": { - "type": "string" - } - } - }, - { - "name": "albumId", - "required": false, - "in": "query", - "schema": { - "format": "uuid", - "type": "string" - } - }, - { - "name": "userId", - "required": false, - "in": "query", - "schema": { - "format": "uuid", - "type": "string" - } - }, - { - "name": "archiveSize", - "required": false, - "in": "query", - "schema": { - "type": "number" - } - }, - { - "name": "key", - "required": false, - "in": "query", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DownloadResponseDto" - } - } - }, - "description": "" - } - }, - "security": [ - { - "bearer": [] - }, - { - "cookie": [] - }, - { - "api_key": [] - } - ], - "tags": [ - "Asset" - ] - }, + "/asset/download/archive": { "post": { "operationId": "downloadArchive", "parameters": [ @@ -1155,6 +1078,57 @@ ] } }, + "/asset/download/info": { + "post": { + "operationId": "getDownloadInfo", + "parameters": [ + { + "name": "key", + "required": false, + "in": "query", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DownloadInfoDto" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DownloadResponseDto" + } + } + }, + "description": "" + } + }, + "security": [ + { + "bearer": [] + }, + { + "cookie": [] + }, + { + "api_key": [] + } + ], + "tags": [ + "Asset" + ] + } + }, "/asset/download/{id}": { "post": { "operationId": "downloadFile", @@ -5549,6 +5523,29 @@ ], "type": "object" }, + "DownloadInfoDto": { + "properties": { + "albumId": { + "format": "uuid", + "type": "string" + }, + "archiveSize": { + "type": "integer" + }, + "assetIds": { + "items": { + "format": "uuid", + "type": "string" + }, + "type": "array" + }, + "userId": { + "format": "uuid", + "type": "string" + } + }, + "type": "object" + }, "DownloadResponseDto": { "properties": { "archives": { diff --git a/server/src/domain/asset/asset.service.ts b/server/src/domain/asset/asset.service.ts index fdd6df6ef..ac655b807 100644 --- a/server/src/domain/asset/asset.service.ts +++ b/server/src/domain/asset/asset.service.ts @@ -13,7 +13,7 @@ import { IAssetRepository } from './asset.repository'; import { AssetIdsDto, DownloadArchiveInfo, - DownloadDto, + DownloadInfoDto, DownloadResponseDto, MemoryLaneDto, TimeBucketAssetDto, @@ -176,7 +176,7 @@ export class AssetService { return this.storageRepository.createReadStream(asset.originalPath, mimeTypes.lookup(asset.originalPath)); } - async getDownloadInfo(authUser: AuthUserDto, dto: DownloadDto): Promise { + async getDownloadInfo(authUser: AuthUserDto, dto: DownloadInfoDto): Promise { const targetSize = dto.archiveSize || HumanReadableSize.GiB * 4; const archives: DownloadArchiveInfo[] = []; let archive: DownloadArchiveInfo = { size: 0, assetIds: [] }; @@ -234,7 +234,7 @@ export class AssetService { return { stream: zip.stream }; } - private async getDownloadAssets(authUser: AuthUserDto, dto: DownloadDto): Promise> { + private async getDownloadAssets(authUser: AuthUserDto, dto: DownloadInfoDto): Promise> { const PAGINATION_SIZE = 2500; if (dto.assetIds) { diff --git a/server/src/domain/asset/dto/download.dto.ts b/server/src/domain/asset/dto/download.dto.ts index c2cf85685..604a8ea5f 100644 --- a/server/src/domain/asset/dto/download.dto.ts +++ b/server/src/domain/asset/dto/download.dto.ts @@ -2,7 +2,7 @@ import { ApiProperty } from '@nestjs/swagger'; import { IsInt, IsOptional, IsPositive } from 'class-validator'; import { ValidateUUID } from '../../domain.util'; -export class DownloadDto { +export class DownloadInfoDto { @ValidateUUID({ each: true, optional: true }) assetIds?: string[]; @@ -15,6 +15,7 @@ export class DownloadDto { @IsInt() @IsPositive() @IsOptional() + @ApiProperty({ type: 'integer' }) archiveSize?: number; } diff --git a/server/src/immich/controllers/asset.controller.ts b/server/src/immich/controllers/asset.controller.ts index ba3de02cc..b55cbb870 100644 --- a/server/src/immich/controllers/asset.controller.ts +++ b/server/src/immich/controllers/asset.controller.ts @@ -5,7 +5,7 @@ import { AssetStatsDto, AssetStatsResponseDto, AuthUserDto, - DownloadDto, + DownloadInfoDto, DownloadResponseDto, MapMarkerResponseDto, MemoryLaneDto, @@ -39,13 +39,13 @@ export class AssetController { } @SharedLinkRoute() - @Get('download') - getDownloadInfo(@AuthUser() authUser: AuthUserDto, @Query() dto: DownloadDto): Promise { + @Post('download/info') + getDownloadInfo(@AuthUser() authUser: AuthUserDto, @Body() dto: DownloadInfoDto): Promise { return this.service.getDownloadInfo(authUser, dto); } @SharedLinkRoute() - @Post('download') + @Post('download/archive') @HttpCode(HttpStatus.OK) @ApiOkResponse({ content: { 'application/octet-stream': { schema: { type: 'string', format: 'binary' } } } }) downloadArchive(@AuthUser() authUser: AuthUserDto, @Body() dto: AssetIdsDto): Promise { diff --git a/web/src/api/open-api/api.ts b/web/src/api/open-api/api.ts index 956f19ba7..8ade1d5fd 100644 --- a/web/src/api/open-api/api.ts +++ b/web/src/api/open-api/api.ts @@ -1132,6 +1132,37 @@ export interface DownloadArchiveInfo { */ 'size': number; } +/** + * + * @export + * @interface DownloadInfoDto + */ +export interface DownloadInfoDto { + /** + * + * @type {string} + * @memberof DownloadInfoDto + */ + 'albumId'?: string; + /** + * + * @type {number} + * @memberof DownloadInfoDto + */ + 'archiveSize'?: number; + /** + * + * @type {Array} + * @memberof DownloadInfoDto + */ + 'assetIds'?: Array; + /** + * + * @type {string} + * @memberof DownloadInfoDto + */ + 'userId'?: string; +} /** * * @export @@ -4880,7 +4911,7 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration downloadArchive: async (assetIdsDto: AssetIdsDto, key?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'assetIdsDto' is not null or undefined assertParamExists('downloadArchive', 'assetIdsDto', assetIdsDto) - const localVarPath = `/asset/download`; + const localVarPath = `/asset/download/archive`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -5379,16 +5410,15 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration }, /** * - * @param {Array} [assetIds] - * @param {string} [albumId] - * @param {string} [userId] - * @param {number} [archiveSize] + * @param {DownloadInfoDto} downloadInfoDto * @param {string} [key] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getDownloadInfo: async (assetIds?: Array, albumId?: string, userId?: string, archiveSize?: number, key?: string, options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/asset/download`; + getDownloadInfo: async (downloadInfoDto: DownloadInfoDto, key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'downloadInfoDto' is not null or undefined + assertParamExists('getDownloadInfo', 'downloadInfoDto', downloadInfoDto) + const localVarPath = `/asset/download/info`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -5396,7 +5426,7 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -5409,31 +5439,18 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) - if (assetIds) { - localVarQueryParameter['assetIds'] = assetIds; - } - - if (albumId !== undefined) { - localVarQueryParameter['albumId'] = albumId; - } - - if (userId !== undefined) { - localVarQueryParameter['userId'] = userId; - } - - if (archiveSize !== undefined) { - localVarQueryParameter['archiveSize'] = archiveSize; - } - if (key !== undefined) { localVarQueryParameter['key'] = key; } + localVarHeaderParameter['Content-Type'] = 'application/json'; + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(downloadInfoDto, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -6141,16 +6158,13 @@ export const AssetApiFp = function(configuration?: Configuration) { }, /** * - * @param {Array} [assetIds] - * @param {string} [albumId] - * @param {string} [userId] - * @param {number} [archiveSize] + * @param {DownloadInfoDto} downloadInfoDto * @param {string} [key] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getDownloadInfo(assetIds?: Array, albumId?: string, userId?: string, archiveSize?: number, key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getDownloadInfo(assetIds, albumId, userId, archiveSize, key, options); + async getDownloadInfo(downloadInfoDto: DownloadInfoDto, key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getDownloadInfo(downloadInfoDto, key, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -6406,8 +6420,8 @@ export const AssetApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getDownloadInfo(requestParameters: AssetApiGetDownloadInfoRequest = {}, options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.getDownloadInfo(requestParameters.assetIds, requestParameters.albumId, requestParameters.userId, requestParameters.archiveSize, requestParameters.key, options).then((request) => request(axios, basePath)); + getDownloadInfo(requestParameters: AssetApiGetDownloadInfoRequest, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.getDownloadInfo(requestParameters.downloadInfoDto, requestParameters.key, options).then((request) => request(axios, basePath)); }, /** * @@ -6788,31 +6802,10 @@ export interface AssetApiGetByTimeBucketRequest { export interface AssetApiGetDownloadInfoRequest { /** * - * @type {Array} + * @type {DownloadInfoDto} * @memberof AssetApiGetDownloadInfo */ - readonly assetIds?: Array - - /** - * - * @type {string} - * @memberof AssetApiGetDownloadInfo - */ - readonly albumId?: string - - /** - * - * @type {string} - * @memberof AssetApiGetDownloadInfo - */ - readonly userId?: string - - /** - * - * @type {number} - * @memberof AssetApiGetDownloadInfo - */ - readonly archiveSize?: number + readonly downloadInfoDto: DownloadInfoDto /** * @@ -7281,8 +7274,8 @@ export class AssetApi extends BaseAPI { * @throws {RequiredError} * @memberof AssetApi */ - public getDownloadInfo(requestParameters: AssetApiGetDownloadInfoRequest = {}, options?: AxiosRequestConfig) { - return AssetApiFp(this.configuration).getDownloadInfo(requestParameters.assetIds, requestParameters.albumId, requestParameters.userId, requestParameters.archiveSize, requestParameters.key, options).then((request) => request(this.axios, this.basePath)); + public getDownloadInfo(requestParameters: AssetApiGetDownloadInfoRequest, options?: AxiosRequestConfig) { + return AssetApiFp(this.configuration).getDownloadInfo(requestParameters.downloadInfoDto, requestParameters.key, options).then((request) => request(this.axios, this.basePath)); } /** diff --git a/web/src/lib/utils/asset-utils.ts b/web/src/lib/utils/asset-utils.ts index 0a8ff758d..cb29b503a 100644 --- a/web/src/lib/utils/asset-utils.ts +++ b/web/src/lib/utils/asset-utils.ts @@ -1,6 +1,6 @@ import { notificationController, NotificationType } from '$lib/components/shared-components/notification/notification'; import { downloadManager } from '$lib/stores/download'; -import { api, AssetApiGetDownloadInfoRequest, BulkIdResponseDto, AssetResponseDto, DownloadResponseDto } from '@api'; +import { api, BulkIdResponseDto, AssetResponseDto, DownloadResponseDto, DownloadInfoDto } from '@api'; import { handleError } from './handle-error'; export const addAssetsToAlbum = async ( @@ -32,15 +32,11 @@ const downloadBlob = (data: Blob, filename: string) => { URL.revokeObjectURL(url); }; -export const downloadArchive = async ( - fileName: string, - options: Omit, - key?: string, -) => { +export const downloadArchive = async (fileName: string, options: DownloadInfoDto, key?: string) => { let downloadInfo: DownloadResponseDto | null = null; try { - const { data } = await api.assetApi.getDownloadInfo({ ...options, key }); + const { data } = await api.assetApi.getDownloadInfo({ downloadInfoDto: options, key }); downloadInfo = data; } catch (error) { handleError(error, 'Unable to download files');