mirror of
https://github.com/immich-app/immich.git
synced 2024-11-24 08:52:28 +02:00
fix(server): library refresh not checking trashed assets (#10495)
* set `withDeleted` * update sql
This commit is contained in:
parent
7ea0278b32
commit
1191978d50
@ -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
|
||||
|
@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user