mirror of
https://github.com/immich-app/immich.git
synced 2026-03-27 12:20:52 +03:00
fix(web): show trash indicator (#12521)
This commit is contained in:
@@ -289,10 +289,10 @@ export class AssetMediaService {
|
||||
async bulkUploadCheck(auth: AuthDto, dto: AssetBulkUploadCheckDto): Promise<AssetBulkUploadCheckResponseDto> {
|
||||
const checksums: Buffer[] = dto.assets.map((asset) => fromChecksum(asset.checksum));
|
||||
const results = await this.assetRepository.getByChecksums(auth.user.id, checksums);
|
||||
const checksumMap: Record<string, string> = {};
|
||||
const checksumMap: Record<string, { id: string; isTrashed: boolean }> = {};
|
||||
|
||||
for (const { id, checksum } of results) {
|
||||
checksumMap[checksum.toString('hex')] = id;
|
||||
for (const { id, deletedAt, checksum } of results) {
|
||||
checksumMap[checksum.toString('hex')] = { id, isTrashed: !!deletedAt };
|
||||
}
|
||||
|
||||
return {
|
||||
@@ -301,14 +301,13 @@ export class AssetMediaService {
|
||||
if (duplicate) {
|
||||
return {
|
||||
id,
|
||||
assetId: duplicate,
|
||||
action: AssetUploadAction.REJECT,
|
||||
reason: AssetRejectReason.DUPLICATE,
|
||||
assetId: duplicate.id,
|
||||
isTrashed: duplicate.isTrashed,
|
||||
};
|
||||
}
|
||||
|
||||
// TODO mime-check
|
||||
|
||||
return {
|
||||
id,
|
||||
action: AssetUploadAction.ACCEPT,
|
||||
|
||||
Reference in New Issue
Block a user