diff --git a/server/src/queries/asset.repository.sql b/server/src/queries/asset.repository.sql index 6968a2b8f5..29d98b9c6f 100644 --- a/server/src/queries/asset.repository.sql +++ b/server/src/queries/asset.repository.sql @@ -320,17 +320,11 @@ FROM FROM "assets" "AssetEntity" LEFT JOIN "libraries" "AssetEntity__AssetEntity_library" ON "AssetEntity__AssetEntity_library"."id" = "AssetEntity"."libraryId" - AND ( - "AssetEntity__AssetEntity_library"."deletedAt" IS NULL - ) WHERE ( - ( - ((("AssetEntity__AssetEntity_library"."id" = $1))) - AND ("AssetEntity"."originalPath" = $2) - ) + ((("AssetEntity__AssetEntity_library"."id" = $1))) + AND ("AssetEntity"."originalPath" = $2) ) - AND ("AssetEntity"."deletedAt" IS NULL) ) "distinctAlias" ORDER BY "AssetEntity_id" ASC diff --git a/server/src/repositories/asset.repository.ts b/server/src/repositories/asset.repository.ts index ee7a97004a..358d7e2bbf 100644 --- a/server/src/repositories/asset.repository.ts +++ b/server/src/repositories/asset.repository.ts @@ -188,7 +188,8 @@ export class AssetRepository implements IAssetRepository { @GenerateSql({ params: [DummyValue.UUID, DummyValue.STRING] }) getByLibraryIdAndOriginalPath(libraryId: string, originalPath: string): Promise { return this.repository.findOne({ - where: { library: { id: libraryId }, originalPath: originalPath }, + where: { library: { id: libraryId }, originalPath }, + withDeleted: true, }); }