[go: nahoru, domu]

Skip to content

Commit

Permalink
fix(server): library refresh not checking trashed assets (immich-app#…
Browse files Browse the repository at this point in the history
…10495)

* set `withDeleted`

* update sql
  • Loading branch information
mertalev committed Jun 19, 2024
1 parent 7ea0278 commit 1191978
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
10 changes: 2 additions & 8 deletions server/src/queries/asset.repository.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion server/src/repositories/asset.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ export class AssetRepository implements IAssetRepository {
@GenerateSql({ params: [DummyValue.UUID, DummyValue.STRING] })
getByLibraryIdAndOriginalPath(libraryId: string, originalPath: string): Promise<AssetEntity | null> {
return this.repository.findOne({
where: { library: { id: libraryId }, originalPath: originalPath },
where: { library: { id: libraryId }, originalPath },
withDeleted: true,
});
}

Expand Down

0 comments on commit 1191978

Please sign in to comment.