mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
fix(server): double exif join (#27485)
This commit is contained in:
@@ -84,7 +84,6 @@ select
|
|||||||
from
|
from
|
||||||
"asset"
|
"asset"
|
||||||
inner join "asset_exif" on "asset"."id" = "asset_exif"."assetId"
|
inner join "asset_exif" on "asset"."id" = "asset_exif"."assetId"
|
||||||
left join "asset_exif" on "asset"."id" = "asset_exif"."assetId"
|
|
||||||
where
|
where
|
||||||
"asset"."visibility" = $1
|
"asset"."visibility" = $1
|
||||||
and "asset"."fileCreatedAt" >= $2
|
and "asset"."fileCreatedAt" >= $2
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { AssetStatus, AssetType, AssetVisibility, VectorIndex } from 'src/enum';
|
|||||||
import { probes } from 'src/repositories/database.repository';
|
import { probes } from 'src/repositories/database.repository';
|
||||||
import { DB } from 'src/schema';
|
import { DB } from 'src/schema';
|
||||||
import { AssetExifTable } from 'src/schema/tables/asset-exif.table';
|
import { AssetExifTable } from 'src/schema/tables/asset-exif.table';
|
||||||
import { anyUuid, searchAssetBuilder, withExif } from 'src/utils/database';
|
import { anyUuid, searchAssetBuilder, withExifInner } from 'src/utils/database';
|
||||||
import { paginationHelper } from 'src/utils/pagination';
|
import { paginationHelper } from 'src/utils/pagination';
|
||||||
import { isValidInteger } from 'src/validation';
|
import { isValidInteger } from 'src/validation';
|
||||||
|
|
||||||
@@ -270,7 +270,7 @@ export class SearchRepository {
|
|||||||
const orderDirection = (options.orderDirection?.toLowerCase() || 'desc') as OrderByDirection;
|
const orderDirection = (options.orderDirection?.toLowerCase() || 'desc') as OrderByDirection;
|
||||||
return searchAssetBuilder(this.db, options)
|
return searchAssetBuilder(this.db, options)
|
||||||
.selectAll('asset')
|
.selectAll('asset')
|
||||||
.$call(withExif)
|
.$call(withExifInner)
|
||||||
.where('asset_exif.fileSizeInByte', '>', options.minFileSize || 0)
|
.where('asset_exif.fileSizeInByte', '>', options.minFileSize || 0)
|
||||||
.orderBy('asset_exif.fileSizeInByte', orderDirection)
|
.orderBy('asset_exif.fileSizeInByte', orderDirection)
|
||||||
.limit(size)
|
.limit(size)
|
||||||
|
|||||||
Reference in New Issue
Block a user