From 3021eca8e56cad9420cd64e1f9bdb3bcb71215d9 Mon Sep 17 00:00:00 2001 From: Jason Rasmussen Date: Tue, 24 Oct 2023 12:59:06 -0400 Subject: [PATCH] chore(server): remove unused method (#4627) * chore(server): remove unused method * chore: open api --- cli/src/api/open-api/api.ts | 139 ------------------ mobile/openapi/.openapi-generator/FILES | 6 - mobile/openapi/README.md | Bin 22177 -> 21937 bytes mobile/openapi/doc/AssetApi.md | Bin 68763 -> 66403 bytes mobile/openapi/doc/CheckDuplicateAssetDto.md | Bin 457 -> 0 bytes .../doc/CheckDuplicateAssetResponseDto.md | Bin 462 -> 0 bytes mobile/openapi/lib/api.dart | Bin 7264 -> 7165 bytes mobile/openapi/lib/api/asset_api.dart | Bin 60368 -> 58283 bytes mobile/openapi/lib/api_client.dart | Bin 21588 -> 21380 bytes .../lib/model/check_duplicate_asset_dto.dart | Bin 3230 -> 0 bytes .../check_duplicate_asset_response_dto.dart | Bin 3648 -> 0 bytes mobile/openapi/test/asset_api_test.dart | Bin 6135 -> 5854 bytes .../test/check_duplicate_asset_dto_test.dart | Bin 701 -> 0 bytes ...eck_duplicate_asset_response_dto_test.dart | Bin 699 -> 0 bytes server/immich-openapi-specs.json | 81 ---------- .../immich/api-v1/asset/asset.controller.ts | 15 -- .../src/immich/api-v1/asset/asset.service.ts | 19 --- .../asset/dto/check-duplicate-asset.dto.ts | 9 -- .../check-duplicate-asset-response.dto.ts | 8 - web/src/api/open-api/api.ts | 139 ------------------ 20 files changed, 416 deletions(-) delete mode 100644 mobile/openapi/doc/CheckDuplicateAssetDto.md delete mode 100644 mobile/openapi/doc/CheckDuplicateAssetResponseDto.md delete mode 100644 mobile/openapi/lib/model/check_duplicate_asset_dto.dart delete mode 100644 mobile/openapi/lib/model/check_duplicate_asset_response_dto.dart delete mode 100644 mobile/openapi/test/check_duplicate_asset_dto_test.dart delete mode 100644 mobile/openapi/test/check_duplicate_asset_response_dto_test.dart delete mode 100644 server/src/immich/api-v1/asset/dto/check-duplicate-asset.dto.ts delete mode 100644 server/src/immich/api-v1/asset/response-dto/check-duplicate-asset-response.dto.ts diff --git a/cli/src/api/open-api/api.ts b/cli/src/api/open-api/api.ts index 799eb9d385..0d63ba3187 100644 --- a/cli/src/api/open-api/api.ts +++ b/cli/src/api/open-api/api.ts @@ -1052,44 +1052,6 @@ export interface ChangePasswordDto { */ 'password': string; } -/** - * - * @export - * @interface CheckDuplicateAssetDto - */ -export interface CheckDuplicateAssetDto { - /** - * - * @type {string} - * @memberof CheckDuplicateAssetDto - */ - 'deviceAssetId': string; - /** - * - * @type {string} - * @memberof CheckDuplicateAssetDto - */ - 'deviceId': string; -} -/** - * - * @export - * @interface CheckDuplicateAssetResponseDto - */ -export interface CheckDuplicateAssetResponseDto { - /** - * - * @type {string} - * @memberof CheckDuplicateAssetResponseDto - */ - 'id'?: string; - /** - * - * @type {boolean} - * @memberof CheckDuplicateAssetResponseDto - */ - 'isExist': boolean; -} /** * * @export @@ -5856,55 +5818,6 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration options: localVarRequestOptions, }; }, - /** - * Check duplicated asset before uploading - for Web upload used - * @param {CheckDuplicateAssetDto} checkDuplicateAssetDto - * @param {string} [key] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - checkDuplicateAsset: async (checkDuplicateAssetDto: CheckDuplicateAssetDto, key?: string, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'checkDuplicateAssetDto' is not null or undefined - assertParamExists('checkDuplicateAsset', 'checkDuplicateAssetDto', checkDuplicateAssetDto) - const localVarPath = `/asset/check`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication cookie required - - // authentication api_key required - await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - - // authentication bearer required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - 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(checkDuplicateAssetDto, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, /** * Checks if multiple assets exist on the server and returns all existing - used by background backup * @param {CheckExistingAssetsDto} checkExistingAssetsDto @@ -7439,17 +7352,6 @@ export const AssetApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.bulkUploadCheck(assetBulkUploadCheckDto, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, - /** - * Check duplicated asset before uploading - for Web upload used - * @param {CheckDuplicateAssetDto} checkDuplicateAssetDto - * @param {string} [key] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async checkDuplicateAsset(checkDuplicateAssetDto: CheckDuplicateAssetDto, key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.checkDuplicateAsset(checkDuplicateAssetDto, key, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, /** * Checks if multiple assets exist on the server and returns all existing - used by background backup * @param {CheckExistingAssetsDto} checkExistingAssetsDto @@ -7805,15 +7707,6 @@ export const AssetApiFactory = function (configuration?: Configuration, basePath bulkUploadCheck(requestParameters: AssetApiBulkUploadCheckRequest, options?: AxiosRequestConfig): AxiosPromise { return localVarFp.bulkUploadCheck(requestParameters.assetBulkUploadCheckDto, options).then((request) => request(axios, basePath)); }, - /** - * Check duplicated asset before uploading - for Web upload used - * @param {AssetApiCheckDuplicateAssetRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - checkDuplicateAsset(requestParameters: AssetApiCheckDuplicateAssetRequest, options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.checkDuplicateAsset(requestParameters.checkDuplicateAssetDto, requestParameters.key, options).then((request) => request(axios, basePath)); - }, /** * Checks if multiple assets exist on the server and returns all existing - used by background backup * @param {AssetApiCheckExistingAssetsRequest} requestParameters Request parameters. @@ -8087,27 +7980,6 @@ export interface AssetApiBulkUploadCheckRequest { readonly assetBulkUploadCheckDto: AssetBulkUploadCheckDto } -/** - * Request parameters for checkDuplicateAsset operation in AssetApi. - * @export - * @interface AssetApiCheckDuplicateAssetRequest - */ -export interface AssetApiCheckDuplicateAssetRequest { - /** - * - * @type {CheckDuplicateAssetDto} - * @memberof AssetApiCheckDuplicateAsset - */ - readonly checkDuplicateAssetDto: CheckDuplicateAssetDto - - /** - * - * @type {string} - * @memberof AssetApiCheckDuplicateAsset - */ - readonly key?: string -} - /** * Request parameters for checkExistingAssets operation in AssetApi. * @export @@ -8819,17 +8691,6 @@ export class AssetApi extends BaseAPI { return AssetApiFp(this.configuration).bulkUploadCheck(requestParameters.assetBulkUploadCheckDto, options).then((request) => request(this.axios, this.basePath)); } - /** - * Check duplicated asset before uploading - for Web upload used - * @param {AssetApiCheckDuplicateAssetRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof AssetApi - */ - public checkDuplicateAsset(requestParameters: AssetApiCheckDuplicateAssetRequest, options?: AxiosRequestConfig) { - return AssetApiFp(this.configuration).checkDuplicateAsset(requestParameters.checkDuplicateAssetDto, requestParameters.key, options).then((request) => request(this.axios, this.basePath)); - } - /** * Checks if multiple assets exist on the server and returns all existing - used by background backup * @param {AssetApiCheckExistingAssetsRequest} requestParameters Request parameters. diff --git a/mobile/openapi/.openapi-generator/FILES b/mobile/openapi/.openapi-generator/FILES index b014ae6ad5..cb9b0ad503 100644 --- a/mobile/openapi/.openapi-generator/FILES +++ b/mobile/openapi/.openapi-generator/FILES @@ -40,8 +40,6 @@ doc/CLIPConfig.md doc/CLIPMode.md doc/CQMode.md doc/ChangePasswordDto.md -doc/CheckDuplicateAssetDto.md -doc/CheckDuplicateAssetResponseDto.md doc/CheckExistingAssetsDto.md doc/CheckExistingAssetsResponseDto.md doc/CitiesFile.md @@ -216,8 +214,6 @@ lib/model/auth_device_response_dto.dart lib/model/bulk_id_response_dto.dart lib/model/bulk_ids_dto.dart lib/model/change_password_dto.dart -lib/model/check_duplicate_asset_dto.dart -lib/model/check_duplicate_asset_response_dto.dart lib/model/check_existing_assets_dto.dart lib/model/check_existing_assets_response_dto.dart lib/model/cities_file.dart @@ -364,8 +360,6 @@ test/authentication_api_test.dart test/bulk_id_response_dto_test.dart test/bulk_ids_dto_test.dart test/change_password_dto_test.dart -test/check_duplicate_asset_dto_test.dart -test/check_duplicate_asset_response_dto_test.dart test/check_existing_assets_dto_test.dart test/check_existing_assets_response_dto_test.dart test/cities_file_test.dart diff --git a/mobile/openapi/README.md b/mobile/openapi/README.md index 125be810d016e85b492b0c997b5a20f4c332b31d..b4760ae801c735b68b1e1b47d8a3dcae49585c0c 100644 GIT binary patch delta 19 bcmZ3umT}{1#tqZ?Hvi`nHP}4Io>d$GR_6z? delta 170 zcmdnEnsMP;#tqZ?_*_a0ax#+>OHv(+i&IM`I|_;lCugK4XQ#l#6T#vSghg1v;*%Lg zL^e<2lQM8c)#*}_AFGj)pRBL%4APDvsh69g$)%vH5REE5x!*=y7*z=B5C_rCE9^MM E0p$igod5s; diff --git a/mobile/openapi/doc/AssetApi.md b/mobile/openapi/doc/AssetApi.md index 075c32bd986adb41dc940d3595ea3bbf6a0d7d17..f80bf42dfa3fdf89fd3b84e0a944174ffcdf0099 100644 GIT binary patch delta 19 bcmbO|ljU(6%LY@%&E1R%f}77upZfp+P|^sM delta 522 zcmaFd#xi>*%LY?MHkZ0&J{iRzl7-IC2RtlgBhI!>meoqbvlA{YH4xVDL8{nL=_K8EiTBt4JFWG QPTMETUwN~6g3#p;0JMm|ivR!s diff --git a/mobile/openapi/doc/CheckDuplicateAssetDto.md b/mobile/openapi/doc/CheckDuplicateAssetDto.md deleted file mode 100644 index 259cdfc81cfaaaaf86e5bf0b998b120b44b11560..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 457 zcma)2!Ab)$5WVLs2KG=J$o8(M)$O5ROHps7upybYp}U!oOa;M@H`x}gf@m(`&Aj(! z=2buey$-G($YNhV9MBxwQ|O)1j7>_&Et3#c1&^dH@Bv|DLeS=@_b9rqvpTYHL!iho zxzukjzO&+82$Q=)9i7%OHzPYtVx%mr*%xOT+ lx-74D6xA40n!=a5Sug&n&7mpuHjwlD&Eh=p$MC5T;sdR6i5anT2+NDic}LHt<}V5*;ff9emr&vqOgD$>z%)Q z?|cQ2N2k3lM>05+cSr0`_1O=$*Njz+$UBUlT*R75h@yZ8(gyg5Fm-^}{Yf8C?Du=4 z0}DHP3Ji<6em(oIaz+LgHyNFrwjn(Rwiv}mj|lJZ^yc$bW9)06guO{I{snt8Tc!FDTMd{y1-mr5r$ ztbS|@Hj``*PMoeWc|9j9@t)+1$Kr{g)Z&8tyy8@#XYB2eT?+FKX+Bq;T+kwJ4E8;0 p;G+a47WvJ5xt2`E_#LROqX|p{3aE-E3tC!EuI9<#9LX7U3jl1%+e`oe diff --git a/mobile/openapi/lib/api_client.dart b/mobile/openapi/lib/api_client.dart index 3f34642b8789399caf810bbf524c9296cb713ee3..51be9d011b0d8e6e1c27162e0cdb33cc3876d52e 100644 GIT binary patch delta 14 Wcmcbzg0W>eY&W*9Oi2 delta 97 zcmZo!&Uj@7_Z#i^4WZ6$=AGg6bYQG`n-CrT*`Vu(*(XsO7D PDmqzE(O~mOmC1SlBQGS< diff --git a/mobile/openapi/lib/model/check_duplicate_asset_dto.dart b/mobile/openapi/lib/model/check_duplicate_asset_dto.dart deleted file mode 100644 index 3d2a3cd57a3298ca10f0573c05a86c8b4aee77c8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3230 zcmbVOZExE)5dQ98aRG)}!Blzcry-ra26ZyHYhs}F1`LKFFcM|4l|_xDVi>9a`|e0d zmSQu0ekq%yr8EZef34vW%+ zivL#%h3+}q;Ag=UejBbd23NY@J(9ULEH|NuF`-BVSJqwkCd)+5b(qO~jbJuo zFv$59mi^W%5Vq8a2k6#s<55I_8VE3{&_T=}MdXssV*jLpd$+&Dq5(b|CGs_NT#sMO zV!QTEK60fHKy-YNG9w5SGg85L?9Cs(@Cbo1DOZ;;o`3^7Vwp$P`SqJ`-`p<{C*gYa z$`OjFO*Emwb0hg z>!20XQ7+-<_Ul=Ecyoka1-p^%hi3sB_H(`Lq#OU#dGsqZW^w&u7O#dj-yJJ{cj3`! zhpi%_2^jf7%N+AL0VN`58GOMd7{ihE)Bdd^!dfiVu#&xD=Nh_&X}_F2EYc759T}O!!RS>9mBy1G@&j1AXOXByG;C zVY`C*myKe3wBn^bWKLj5!s=zGF4#eYR_z&dB3M0=+C*RtFY;gs8#|s(wGPgl>XLE= z&3z)oBOPxpbVG5Izr!i6s$I=$Ku?0}dQZfV+t<15+HirjZgKS;mJzh2bNtG8G>@&n z(<+tl0@di+G#PFlA8907tfV{2x5A{jMBPRAoqk4MJ7e^%W-cBv=tS2)ig}oecdg@y z)OD)WCges2y_)giypF~gZ8g1^@JBRtrd-aEUNw(f)8f0z!rgUg@8>2U>KYhZ0`r@O zKD4&qsLqL|GZ!#nODrQ;q`c8Za|uNWYP=9IB)&w+JaE9nQ)60c5(XbW&+q9*TTKpo hqBb|!zsR?_f=r$)D9`R2?!>7U@f4wFyrJMY`X58v9Yp{D diff --git a/mobile/openapi/lib/model/check_duplicate_asset_response_dto.dart b/mobile/openapi/lib/model/check_duplicate_asset_response_dto.dart deleted file mode 100644 index f16ba2e9e54331ecedf601faaf7ff72f83e34704..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3648 zcmbVPU2hXP6n)RHxJ4_HYKN5NX;nx7(XxVtW(D1qR#7!_XPm|`v1e@$*{Jlt@42=o znbMGSK_bnJ@0ag6_t-f)>Kz@?%RkR2kA6EnJN@wT{Pcugzj=3>(aD6)Cg=2ia`NW& z-v=;b%NM1ve)MGc%aa~Isw-`*%xA{tGgZlBYINgdnafHpr1n|+tQNJgeyfM5mSW}d zy79S{|1`?NU5f=iYhm%%OY0Eay6x_T(asC)b5$atnki|6yW5(qQd+vaGWrT;elB$W z>*Ktb3+sA4r1NBEWNN8Jt%msjwAU*t;T*l1%i{A%Q&*}GUcPir`VZ38$SqI2q3a&e z5!&%V`o?NUg0x)Hbhp<9sZe?$hj8C*JKzjNey-e5m05UbyOrL$(|?uoymWJjx%$(ZkFOYiY`U*nb3ID&9Tw%R5JNh9s0>|yaGO;g(Xpz(QHcr zsQWt`3<=!G6-$z?;et=Dn~zII$9v`5c6F0L;Uxmeip-JRIZ>gsu&}~TW2)l#|fJ$ zEh_qiS2UtK*4H;r!v@rh0#e-QgHa$~8-RlI)b>@`zd(#MveEB`WQ9SDsnF7IY`Ja8 zFr?Y6$9;4Hw(v3LHmFXB#ojk*_8wB^?sS7;}cQO@U!>Igd#W0SEhYX#L!jOr-c?59gnUiUN8G z%~)xR1cMY62;+nD+V=$Y>VOxl~4{U&@SBD6FLL`bcChqK|??&`->!RR$m zzSYxM?{yHdD{Gc~Fo4&PVJEYjwyCkDRyx*wOwOKE(~DR)W5fwq;kZNyR^ahaxijNW z7qwrt82}s9bC435CF?f3Zq{31Bj}?&^cgar!%nfO)W(3snl^VPo0sDjhd5CpxjLQ^ zgcgijkR&f}c$0&+jmOk}3sJgwb+u|wFPUgtQENLBTL!DHr0ogXRk{`+)U*?yU^j~R zeQ%y19~(Vr?{_(_Shz{@jWHf0x3I=ryK2!M@{^LT-5Wy^_xFEM4`GMFtApW2G`6CT zCQhT{XSrf|5B`zMT*?j#z_p{!3>xcZ=$VQ4fu-_uyy7Y3d+2V29z`d_NCM5b6M!1u6eWmT>y$Y+&=^e!58OC$tSQwS{^1r pZ$D1X_(Gdbh;S@J-r`TN-`RJ40~%k4=JeAk)epZip7tPE{{b4vsign_ diff --git a/mobile/openapi/test/asset_api_test.dart b/mobile/openapi/test/asset_api_test.dart index 8e45a1e3cb74491e3a6912e565db6ebc5b0ab983..e7b2978eb459ba88db7ac3242738795fbab628da 100644 GIT binary patch delta 12 Tcmeyae@}PACZ^4&nRP?}DR2c> delta 186 zcmcbo`(1y-CMFAol+uEn%;dz9)D(rp;^Nd2g{0K9{GwC^pm2U-N@iZVg02EkKp{Le z2`Z*gTAZ3PnV(rI(gmj15u`IHwYVTZuQ=7EB;QUUIU_YW8&zJz8B+|X7Ms$^vstwG QP>qi_@% diff --git a/mobile/openapi/test/check_duplicate_asset_dto_test.dart b/mobile/openapi/test/check_duplicate_asset_dto_test.dart deleted file mode 100644 index 2e8572da4533aadaeed73976b544bc6295d24313..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 701 zcma)&QES356oudOEAF0DaCY-)D8gi|qp(@nx`#c*klwbzHp!CIA;bT^w4Dz_1s|H` z!a3(VH$gyx0G1zVa{C;uqqk)mg|LcWqA`RCtdkU8lQ3R=-gsH7e9V|}i|OQkO4?Br zQW>PVGBg(z&Y+Qv#f)NwHA*)=&Z5@JxU&vceY3r#x^dLtS0jwKOIG_+GvogbjrHNi zp0{%)tz*(rk$IrV1)9!o&%!Dp(b7uE!pmIABz?G}yky1_(szV`W_-&EoGFcxX%YBu z(r!JNpGX{97qrJw&_dhUf`1ZtDv@u)MpuF}hf8bGg-(&35*gG?$l(Zn2!QwGLb3`( zw+csCT(AyDbK(t!QH>rBTF?dIU<`lZUHrQCjg@#a&H`v+E!p*TD|t7pei{ivR!s diff --git a/mobile/openapi/test/check_duplicate_asset_response_dto_test.dart b/mobile/openapi/test/check_duplicate_asset_response_dto_test.dart deleted file mode 100644 index 2c0d28bb3731b617c6a29668ab9100b096e6d42b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 699 zcma)(QBT4!6oudSE3QvKf=qcb5)z3UhD2F{^TDT5x68O;w6*P2V)*ag6?u{bAJ+9Q z=R4=Li{mJcVe*n^mk;SYT}<*cf$8iq?L(5mJj>xJOJ>v83zoIYyHZ*|9uBUDQ9Dwl zv_-MfR;;MTTWD0{uoPJ17M1TGXWANV{YgUBpK|AfX}qxb-jHQn$t|x&T7G-9j?Jw* zjTc%uFO?Tmav-e;ZNS~hu$mM)QEOGP%&(;qH&>!qOY5TO&=ERD78_aNtv0Bnp_rdR zd+N^UkHn+%al0G^ZD>0?;46XqH5QwsF*Oy^2d!rwu*>bo%fc7UG`0B~<~HYyzP;yXde1zeX^YFTwg9 vEU8=`Sm}1E2z6V8E9Y5~1$=)f6F$Ca&Bt)*7x8a9>wVDuFM!=b&_4PBF(Bim diff --git a/server/immich-openapi-specs.json b/server/immich-openapi-specs.json index ca0f77f9b6..7ae3275585 100644 --- a/server/immich-openapi-specs.json +++ b/server/immich-openapi-specs.json @@ -927,58 +927,6 @@ ] } }, - "/asset/check": { - "post": { - "description": "Check duplicated asset before uploading - for Web upload used", - "operationId": "checkDuplicateAsset", - "parameters": [ - { - "name": "key", - "required": false, - "in": "query", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CheckDuplicateAssetDto" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CheckDuplicateAssetResponseDto" - } - } - }, - "description": "" - } - }, - "security": [ - { - "bearer": [] - }, - { - "cookie": [] - }, - { - "api_key": [] - } - ], - "tags": [ - "Asset" - ] - } - }, "/asset/curated-locations": { "get": { "operationId": "getCuratedLocations", @@ -6269,35 +6217,6 @@ ], "type": "object" }, - "CheckDuplicateAssetDto": { - "properties": { - "deviceAssetId": { - "type": "string" - }, - "deviceId": { - "type": "string" - } - }, - "required": [ - "deviceAssetId", - "deviceId" - ], - "type": "object" - }, - "CheckDuplicateAssetResponseDto": { - "properties": { - "id": { - "type": "string" - }, - "isExist": { - "type": "boolean" - } - }, - "required": [ - "isExist" - ], - "type": "object" - }, "CheckExistingAssetsDto": { "properties": { "deviceAssetIds": { diff --git a/server/src/immich/api-v1/asset/asset.controller.ts b/server/src/immich/api-v1/asset/asset.controller.ts index 9df52f7104..ed50e3becc 100644 --- a/server/src/immich/api-v1/asset/asset.controller.ts +++ b/server/src/immich/api-v1/asset/asset.controller.ts @@ -23,7 +23,6 @@ import FileNotEmptyValidator from '../validation/file-not-empty-validator'; import { AssetService } from './asset.service'; import { AssetBulkUploadCheckDto } from './dto/asset-check.dto'; import { AssetSearchDto } from './dto/asset-search.dto'; -import { CheckDuplicateAssetDto } from './dto/check-duplicate-asset.dto'; import { CheckExistingAssetsDto } from './dto/check-existing-assets.dto'; import { CreateAssetDto, ImportAssetDto } from './dto/create-asset.dto'; import { DeviceIdDto } from './dto/device-id.dto'; @@ -32,7 +31,6 @@ import { SearchAssetDto } from './dto/search-asset.dto'; import { ServeFileDto } from './dto/serve-file.dto'; import { AssetBulkUploadCheckResponseDto } from './response-dto/asset-check-response.dto'; import { AssetFileUploadResponseDto } from './response-dto/asset-file-upload-response.dto'; -import { CheckDuplicateAssetResponseDto } from './response-dto/check-duplicate-asset-response.dto'; import { CheckExistingAssetsResponseDto } from './response-dto/check-existing-assets-response.dto'; import { CuratedLocationsResponseDto } from './response-dto/curated-locations-response.dto'; import { CuratedObjectsResponseDto } from './response-dto/curated-objects-response.dto'; @@ -189,19 +187,6 @@ export class AssetController { return this.assetService.getAssetById(authUser, id) as Promise; } - /** - * Check duplicated asset before uploading - for Web upload used - */ - @SharedLinkRoute() - @Post('/check') - @HttpCode(HttpStatus.OK) - checkDuplicateAsset( - @AuthUser() authUser: AuthUserDto, - @Body(ValidationPipe) dto: CheckDuplicateAssetDto, - ): Promise { - return this.assetService.checkDuplicatedAsset(authUser, dto); - } - /** * Checks if multiple assets exist on the server and returns all existing - used by background backup */ diff --git a/server/src/immich/api-v1/asset/asset.service.ts b/server/src/immich/api-v1/asset/asset.service.ts index da0209c086..f6886a2550 100644 --- a/server/src/immich/api-v1/asset/asset.service.ts +++ b/server/src/immich/api-v1/asset/asset.service.ts @@ -34,7 +34,6 @@ import { IAssetRepository } from './asset-repository'; import { AssetCore } from './asset.core'; import { AssetBulkUploadCheckDto } from './dto/asset-check.dto'; import { AssetSearchDto } from './dto/asset-search.dto'; -import { CheckDuplicateAssetDto } from './dto/check-duplicate-asset.dto'; import { CheckExistingAssetsDto } from './dto/check-existing-assets.dto'; import { CreateAssetDto, ImportAssetDto } from './dto/create-asset.dto'; import { GetAssetThumbnailDto, GetAssetThumbnailFormatEnum } from './dto/get-asset-thumbnail.dto'; @@ -47,7 +46,6 @@ import { AssetUploadAction, } from './response-dto/asset-check-response.dto'; import { AssetFileUploadResponseDto } from './response-dto/asset-file-upload-response.dto'; -import { CheckDuplicateAssetResponseDto } from './response-dto/check-duplicate-asset-response.dto'; import { CheckExistingAssetsResponseDto } from './response-dto/check-existing-assets-response.dto'; import { CuratedLocationsResponseDto } from './response-dto/curated-locations-response.dto'; import { CuratedObjectsResponseDto } from './response-dto/curated-objects-response.dto'; @@ -319,23 +317,6 @@ export class AssetService { return this._assetRepository.getDetectedObjectsByUserId(authUser.id); } - async checkDuplicatedAsset( - authUser: AuthUserDto, - checkDuplicateAssetDto: CheckDuplicateAssetDto, - ): Promise { - const res = await this.assetRepository.findOne({ - where: { - deviceAssetId: checkDuplicateAssetDto.deviceAssetId, - deviceId: checkDuplicateAssetDto.deviceId, - ownerId: authUser.id, - }, - }); - - const isDuplicated = res ? true : false; - - return new CheckDuplicateAssetResponseDto(isDuplicated, res?.id); - } - async checkExistingAssets( authUser: AuthUserDto, checkExistingAssetsDto: CheckExistingAssetsDto, diff --git a/server/src/immich/api-v1/asset/dto/check-duplicate-asset.dto.ts b/server/src/immich/api-v1/asset/dto/check-duplicate-asset.dto.ts deleted file mode 100644 index 5f2f6161dd..0000000000 --- a/server/src/immich/api-v1/asset/dto/check-duplicate-asset.dto.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { IsNotEmpty } from 'class-validator'; - -export class CheckDuplicateAssetDto { - @IsNotEmpty() - deviceAssetId!: string; - - @IsNotEmpty() - deviceId!: string; -} diff --git a/server/src/immich/api-v1/asset/response-dto/check-duplicate-asset-response.dto.ts b/server/src/immich/api-v1/asset/response-dto/check-duplicate-asset-response.dto.ts deleted file mode 100644 index 0ab8285ed6..0000000000 --- a/server/src/immich/api-v1/asset/response-dto/check-duplicate-asset-response.dto.ts +++ /dev/null @@ -1,8 +0,0 @@ -export class CheckDuplicateAssetResponseDto { - constructor(isExist: boolean, id?: string) { - this.isExist = isExist; - this.id = id; - } - isExist: boolean; - id?: string; -} diff --git a/web/src/api/open-api/api.ts b/web/src/api/open-api/api.ts index 799eb9d385..0d63ba3187 100644 --- a/web/src/api/open-api/api.ts +++ b/web/src/api/open-api/api.ts @@ -1052,44 +1052,6 @@ export interface ChangePasswordDto { */ 'password': string; } -/** - * - * @export - * @interface CheckDuplicateAssetDto - */ -export interface CheckDuplicateAssetDto { - /** - * - * @type {string} - * @memberof CheckDuplicateAssetDto - */ - 'deviceAssetId': string; - /** - * - * @type {string} - * @memberof CheckDuplicateAssetDto - */ - 'deviceId': string; -} -/** - * - * @export - * @interface CheckDuplicateAssetResponseDto - */ -export interface CheckDuplicateAssetResponseDto { - /** - * - * @type {string} - * @memberof CheckDuplicateAssetResponseDto - */ - 'id'?: string; - /** - * - * @type {boolean} - * @memberof CheckDuplicateAssetResponseDto - */ - 'isExist': boolean; -} /** * * @export @@ -5856,55 +5818,6 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration options: localVarRequestOptions, }; }, - /** - * Check duplicated asset before uploading - for Web upload used - * @param {CheckDuplicateAssetDto} checkDuplicateAssetDto - * @param {string} [key] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - checkDuplicateAsset: async (checkDuplicateAssetDto: CheckDuplicateAssetDto, key?: string, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'checkDuplicateAssetDto' is not null or undefined - assertParamExists('checkDuplicateAsset', 'checkDuplicateAssetDto', checkDuplicateAssetDto) - const localVarPath = `/asset/check`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication cookie required - - // authentication api_key required - await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - - // authentication bearer required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - 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(checkDuplicateAssetDto, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, /** * Checks if multiple assets exist on the server and returns all existing - used by background backup * @param {CheckExistingAssetsDto} checkExistingAssetsDto @@ -7439,17 +7352,6 @@ export const AssetApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.bulkUploadCheck(assetBulkUploadCheckDto, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, - /** - * Check duplicated asset before uploading - for Web upload used - * @param {CheckDuplicateAssetDto} checkDuplicateAssetDto - * @param {string} [key] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async checkDuplicateAsset(checkDuplicateAssetDto: CheckDuplicateAssetDto, key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.checkDuplicateAsset(checkDuplicateAssetDto, key, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, /** * Checks if multiple assets exist on the server and returns all existing - used by background backup * @param {CheckExistingAssetsDto} checkExistingAssetsDto @@ -7805,15 +7707,6 @@ export const AssetApiFactory = function (configuration?: Configuration, basePath bulkUploadCheck(requestParameters: AssetApiBulkUploadCheckRequest, options?: AxiosRequestConfig): AxiosPromise { return localVarFp.bulkUploadCheck(requestParameters.assetBulkUploadCheckDto, options).then((request) => request(axios, basePath)); }, - /** - * Check duplicated asset before uploading - for Web upload used - * @param {AssetApiCheckDuplicateAssetRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - checkDuplicateAsset(requestParameters: AssetApiCheckDuplicateAssetRequest, options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.checkDuplicateAsset(requestParameters.checkDuplicateAssetDto, requestParameters.key, options).then((request) => request(axios, basePath)); - }, /** * Checks if multiple assets exist on the server and returns all existing - used by background backup * @param {AssetApiCheckExistingAssetsRequest} requestParameters Request parameters. @@ -8087,27 +7980,6 @@ export interface AssetApiBulkUploadCheckRequest { readonly assetBulkUploadCheckDto: AssetBulkUploadCheckDto } -/** - * Request parameters for checkDuplicateAsset operation in AssetApi. - * @export - * @interface AssetApiCheckDuplicateAssetRequest - */ -export interface AssetApiCheckDuplicateAssetRequest { - /** - * - * @type {CheckDuplicateAssetDto} - * @memberof AssetApiCheckDuplicateAsset - */ - readonly checkDuplicateAssetDto: CheckDuplicateAssetDto - - /** - * - * @type {string} - * @memberof AssetApiCheckDuplicateAsset - */ - readonly key?: string -} - /** * Request parameters for checkExistingAssets operation in AssetApi. * @export @@ -8819,17 +8691,6 @@ export class AssetApi extends BaseAPI { return AssetApiFp(this.configuration).bulkUploadCheck(requestParameters.assetBulkUploadCheckDto, options).then((request) => request(this.axios, this.basePath)); } - /** - * Check duplicated asset before uploading - for Web upload used - * @param {AssetApiCheckDuplicateAssetRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof AssetApi - */ - public checkDuplicateAsset(requestParameters: AssetApiCheckDuplicateAssetRequest, options?: AxiosRequestConfig) { - return AssetApiFp(this.configuration).checkDuplicateAsset(requestParameters.checkDuplicateAssetDto, requestParameters.key, options).then((request) => request(this.axios, this.basePath)); - } - /** * Checks if multiple assets exist on the server and returns all existing - used by background backup * @param {AssetApiCheckExistingAssetsRequest} requestParameters Request parameters.