Skip to content

Commit

Permalink
Merge branch 'feat/nullable-dates' of https://github.com/immich-app/i…
Browse files Browse the repository at this point in the history
…mmich into feat/inline-offline-check
  • Loading branch information
etnoy committed Jan 28, 2025
2 parents 2504dbb + 227ab4d commit 3eb7f29
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/src/entities/asset.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ export function searchAssetBuilder(kysely: Kysely<DB>, options: AssetSearchBuild
.$if(!!options.withExif, withExifInner)
.$if(!!(options.withFaces || options.withPeople || options.personIds), (qb) => qb.select(withFacesAndPeople))
.$if(!options.withDeleted, (qb) => qb.where('assets.deletedAt', 'is', null))
.$if(!options.withNullLocalDateTime, (qb) => qb.where('assets.localDateTime', 'is not', null))
.$if(!options.withNullFileModifiedAt, (qb) => qb.where('assets.fileModifiedAt', 'is not', null))
.$if(!options.withNullFileCreatedAt, (qb) => qb.where('assets.fileCreatedAt', 'is not', null))
.$if(!options.withNullFileModifiedAt, (qb) => qb.where('assets.fileModifiedAt', 'is not', null));
.$if(!options.withNullLocalDateTime, (qb) => qb.where('assets.localDateTime', 'is not', null));
}
12 changes: 12 additions & 0 deletions server/src/queries/search.repository.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ where
and "assets"."isFavorite" = $4
and "assets"."isArchived" = $5
and "assets"."deletedAt" is null
and "assets"."fileModifiedAt" is not null
and "assets"."fileCreatedAt" is not null
and "assets"."localDateTime" is not null
order by
"assets"."fileCreatedAt" desc
limit
Expand All @@ -34,6 +37,9 @@ offset
and "assets"."isFavorite" = $4
and "assets"."isArchived" = $5
and "assets"."deletedAt" is null
and "assets"."fileModifiedAt" is not null
and "assets"."fileCreatedAt" is not null
and "assets"."localDateTime" is not null
and "assets"."id" < $6
order by
random()
Expand All @@ -54,6 +60,9 @@ union all
and "assets"."isFavorite" = $11
and "assets"."isArchived" = $12
and "assets"."deletedAt" is null
and "assets"."fileModifiedAt" is not null
and "assets"."fileCreatedAt" is not null
and "assets"."localDateTime" is not null
and "assets"."id" > $13
order by
random()
Expand All @@ -77,6 +86,9 @@ where
and "assets"."isFavorite" = $4
and "assets"."isArchived" = $5
and "assets"."deletedAt" is null
and "assets"."fileModifiedAt" is not null
and "assets"."fileCreatedAt" is not null
and "assets"."localDateTime" is not null
order by
smart_search.embedding <=> $6
limit
Expand Down

0 comments on commit 3eb7f29

Please sign in to comment.