mirror of
https://github.com/immich-app/immich.git
synced 2024-11-28 09:33:27 +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
|
FROM
|
||||||
"assets" "AssetEntity"
|
"assets" "AssetEntity"
|
||||||
LEFT JOIN "libraries" "AssetEntity__AssetEntity_library" ON "AssetEntity__AssetEntity_library"."id" = "AssetEntity"."libraryId"
|
LEFT JOIN "libraries" "AssetEntity__AssetEntity_library" ON "AssetEntity__AssetEntity_library"."id" = "AssetEntity"."libraryId"
|
||||||
AND (
|
|
||||||
"AssetEntity__AssetEntity_library"."deletedAt" IS NULL
|
|
||||||
)
|
|
||||||
WHERE
|
WHERE
|
||||||
(
|
(
|
||||||
(
|
((("AssetEntity__AssetEntity_library"."id" = $1)))
|
||||||
((("AssetEntity__AssetEntity_library"."id" = $1)))
|
AND ("AssetEntity"."originalPath" = $2)
|
||||||
AND ("AssetEntity"."originalPath" = $2)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
AND ("AssetEntity"."deletedAt" IS NULL)
|
|
||||||
) "distinctAlias"
|
) "distinctAlias"
|
||||||
ORDER BY
|
ORDER BY
|
||||||
"AssetEntity_id" ASC
|
"AssetEntity_id" ASC
|
||||||
|
@ -188,7 +188,8 @@ export class AssetRepository implements IAssetRepository {
|
|||||||
@GenerateSql({ params: [DummyValue.UUID, DummyValue.STRING] })
|
@GenerateSql({ params: [DummyValue.UUID, DummyValue.STRING] })
|
||||||
getByLibraryIdAndOriginalPath(libraryId: string, originalPath: string): Promise<AssetEntity | null> {
|
getByLibraryIdAndOriginalPath(libraryId: string, originalPath: string): Promise<AssetEntity | null> {
|
||||||
return this.repository.findOne({
|
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