mirror of
https://github.com/immich-app/immich.git
synced 2026-03-04 09:57:33 +03: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:
committed by
GitHub
parent
c547d849d9
commit
9fbd6369b9
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user