mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
chore(server): remove unused method (#4627)
* chore(server): remove unused method * chore: open api
This commit is contained in:
@@ -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<AssetResponseDto>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check duplicated asset before uploading - for Web upload used
|
||||
*/
|
||||
@SharedLinkRoute()
|
||||
@Post('/check')
|
||||
@HttpCode(HttpStatus.OK)
|
||||
checkDuplicateAsset(
|
||||
@AuthUser() authUser: AuthUserDto,
|
||||
@Body(ValidationPipe) dto: CheckDuplicateAssetDto,
|
||||
): Promise<CheckDuplicateAssetResponseDto> {
|
||||
return this.assetService.checkDuplicatedAsset(authUser, dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if multiple assets exist on the server and returns all existing - used by background backup
|
||||
*/
|
||||
|
||||
@@ -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<CheckDuplicateAssetResponseDto> {
|
||||
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,
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
import { IsNotEmpty } from 'class-validator';
|
||||
|
||||
export class CheckDuplicateAssetDto {
|
||||
@IsNotEmpty()
|
||||
deviceAssetId!: string;
|
||||
|
||||
@IsNotEmpty()
|
||||
deviceId!: string;
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
export class CheckDuplicateAssetResponseDto {
|
||||
constructor(isExist: boolean, id?: string) {
|
||||
this.isExist = isExist;
|
||||
this.id = id;
|
||||
}
|
||||
isExist: boolean;
|
||||
id?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user