mirror of
https://github.com/immich-app/immich.git
synced 2024-11-24 08:52:28 +02:00
fix(server): fix inconsistent explore queries (#5774)
* remove limits * update sql
This commit is contained in:
parent
08f66c2ae5
commit
e3fa32ad23
@ -706,9 +706,7 @@ export class AssetRepository implements IAssetRepository {
|
||||
.createQueryBuilder('e')
|
||||
.select('city')
|
||||
.groupBy('city')
|
||||
.having('count(city) >= :minAssetsPerField', { minAssetsPerField })
|
||||
.orderBy('random()')
|
||||
.limit(maxFields);
|
||||
.having('count(city) >= :minAssetsPerField', { minAssetsPerField });
|
||||
|
||||
const items = await this.getBuilder({
|
||||
userIds: [ownerId],
|
||||
@ -737,9 +735,7 @@ export class AssetRepository implements IAssetRepository {
|
||||
.createQueryBuilder('si')
|
||||
.select('unnest(tags)', 'tag')
|
||||
.groupBy('tag')
|
||||
.having('count(*) >= :minAssetsPerField', { minAssetsPerField })
|
||||
.orderBy('random()')
|
||||
.limit(maxFields);
|
||||
.having('count(*) >= :minAssetsPerField', { minAssetsPerField });
|
||||
|
||||
const items = await this.getBuilder({
|
||||
userIds: [ownerId],
|
||||
|
@ -618,10 +618,6 @@ WITH
|
||||
city
|
||||
HAVING
|
||||
count(city) >= $1
|
||||
ORDER BY
|
||||
random() ASC
|
||||
LIMIT
|
||||
12
|
||||
)
|
||||
SELECT DISTINCT
|
||||
ON (c.city) "asset"."id" AS "data",
|
||||
@ -653,10 +649,6 @@ WITH
|
||||
tag
|
||||
HAVING
|
||||
count(*) >= $1
|
||||
ORDER BY
|
||||
random() ASC
|
||||
LIMIT
|
||||
12
|
||||
)
|
||||
SELECT DISTINCT
|
||||
ON (unnest("si"."tags")) "asset"."id" AS "data",
|
||||
|
Loading…
Reference in New Issue
Block a user