1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-17 01:06:46 +01:00

fix(server): places page not working with partner sharing (#8257)

This commit is contained in:
Mert 2024-03-25 01:59:11 -04:00 committed by GitHub
parent c788160532
commit 4a6a0aa142
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View file

@ -278,7 +278,7 @@ WITH RECURSIVE
exif exif
INNER JOIN assets ON exif."assetId" = assets.id INNER JOIN assets ON exif."assetId" = assets.id
WHERE WHERE
"ownerId" IN ($1) "ownerId" = ANY ('$1'::uuid [])
AND "isVisible" = $2 AND "isVisible" = $2
AND "isArchived" = $3 AND "isArchived" = $3
AND type = $4 AND type = $4
@ -302,7 +302,7 @@ WITH RECURSIVE
INNER JOIN assets ON exif."assetId" = assets.id INNER JOIN assets ON exif."assetId" = assets.id
WHERE WHERE
city > c.city city > c.city
AND "ownerId" IN ($1) AND "ownerId" = ANY ('$1'::uuid [])
AND "isVisible" = $2 AND "isVisible" = $2
AND "isArchived" = $3 AND "isArchived" = $3
AND type = $4 AND type = $4

View file

@ -225,9 +225,9 @@ export class SearchRepository implements ISearchRepository {
.getMany(); .getMany();
} }
@GenerateSql({ params: [[DummyValue.UUID]] }) @GenerateSql({ params: [[DummyValue.UUID, DummyValue.UUID]] })
async getAssetsByCity(userIds: string[]): Promise<AssetEntity[]> { async getAssetsByCity(userIds: string[]): Promise<AssetEntity[]> {
const parameters = [userIds.join(', '), true, false, AssetType.IMAGE]; const parameters = [userIds, true, false, AssetType.IMAGE];
const rawRes = await this.repository.query(this.assetsByCityQuery, parameters); const rawRes = await this.repository.query(this.assetsByCityQuery, parameters);
const items: AssetEntity[] = []; const items: AssetEntity[] = [];
@ -315,7 +315,7 @@ WITH RECURSIVE cte AS (
SELECT city, "assetId" SELECT city, "assetId"
FROM exif FROM exif
INNER JOIN assets ON exif."assetId" = assets.id INNER JOIN assets ON exif."assetId" = assets.id
WHERE "ownerId" IN ($1) AND "isVisible" = $2 AND "isArchived" = $3 AND type = $4 WHERE "ownerId" = ANY('$1'::uuid[]) AND "isVisible" = $2 AND "isArchived" = $3 AND type = $4
ORDER BY city ORDER BY city
LIMIT 1 LIMIT 1
) )
@ -328,7 +328,7 @@ WITH RECURSIVE cte AS (
SELECT city, "assetId" SELECT city, "assetId"
FROM exif FROM exif
INNER JOIN assets ON exif."assetId" = assets.id INNER JOIN assets ON exif."assetId" = assets.id
WHERE city > c.city AND "ownerId" IN ($1) AND "isVisible" = $2 AND "isArchived" = $3 AND type = $4 WHERE city > c.city AND "ownerId" = ANY('$1'::uuid[]) AND "isVisible" = $2 AND "isArchived" = $3 AND type = $4
ORDER BY city ORDER BY city
LIMIT 1 LIMIT 1
) l ) l