mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
fix(server): check asset against multiple import paths (#17128)
* fix sql logic * refactor: map import paths into not or sql statements --------- Co-authored-by: Zack Pollard <zackpollard@ymail.com>
This commit is contained in:
parent
c547d849d9
commit
9fbd6369b9
2 changed files with 131 additions and 1 deletions
|
|
@ -1062,7 +1062,10 @@ export class AssetRepository {
|
|||
.where('isExternal', '=', true)
|
||||
.where('libraryId', '=', asUuid(libraryId))
|
||||
.where((eb) =>
|
||||
eb.or([eb('originalPath', 'not like', paths.join('|')), eb('originalPath', 'like', exclusions.join('|'))]),
|
||||
eb.or([
|
||||
eb.not(eb.or(paths.map((path) => eb('originalPath', 'like', path)))),
|
||||
eb('originalPath', 'like', exclusions.join('|')),
|
||||
]),
|
||||
)
|
||||
.executeTakeFirstOrThrow();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue