mirror of
https://github.com/immich-app/immich.git
synced 2025-03-25 17:32:33 +01:00
feat(server): search by partial asset path (#16173)
Similarly to how one can search by partial filename, change the path search to work with partial matches instead of looking for a full match. Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
parent
b13a98646f
commit
8634c59850
1 changed files with 3 additions and 1 deletions
|
@ -394,7 +394,9 @@ export function searchAssetBuilder(kysely: Kysely<DB>, options: AssetSearchBuild
|
|||
.$if(!!options.libraryId, (qb) => qb.where('assets.libraryId', '=', asUuid(options.libraryId!)))
|
||||
.$if(!!options.userIds, (qb) => qb.where('assets.ownerId', '=', anyUuid(options.userIds!)))
|
||||
.$if(!!options.encodedVideoPath, (qb) => qb.where('assets.encodedVideoPath', '=', options.encodedVideoPath!))
|
||||
.$if(!!options.originalPath, (qb) => qb.where('assets.originalPath', '=', options.originalPath!))
|
||||
.$if(!!options.originalPath, (qb) =>
|
||||
qb.where(sql`f_unaccent(assets."originalPath")`, 'ilike', sql`'%' || f_unaccent(${options.originalPath}) || '%'`),
|
||||
)
|
||||
.$if(!!options.originalFileName, (qb) =>
|
||||
qb.where(
|
||||
sql`f_unaccent(assets."originalFileName")`,
|
||||
|
|
Loading…
Add table
Reference in a new issue