mirror of
https://github.com/immich-app/immich.git
synced 2025-01-09 13:26:47 +01:00
fixes for sync queries
This commit is contained in:
parent
7ed62d4149
commit
c91a139eeb
1 changed files with 5 additions and 7 deletions
|
@ -685,6 +685,9 @@ export class AssetRepository implements IAssetRepository {
|
||||||
const { ownerId, lastId, updatedUntil, limit } = options;
|
const { ownerId, lastId, updatedUntil, limit } = options;
|
||||||
return this.db
|
return this.db
|
||||||
.selectFrom('assets')
|
.selectFrom('assets')
|
||||||
|
.selectAll('assets')
|
||||||
|
.$call(withExif)
|
||||||
|
.$call((qb) => withStack(qb, { assets: false }))
|
||||||
.where('ownerId', '=', asUuid(ownerId))
|
.where('ownerId', '=', asUuid(ownerId))
|
||||||
.where('isVisible', '=', true)
|
.where('isVisible', '=', true)
|
||||||
.where('updatedAt', '<=', updatedUntil)
|
.where('updatedAt', '<=', updatedUntil)
|
||||||
|
@ -699,13 +702,8 @@ export class AssetRepository implements IAssetRepository {
|
||||||
return this.db
|
return this.db
|
||||||
.selectFrom('assets')
|
.selectFrom('assets')
|
||||||
.selectAll('assets')
|
.selectAll('assets')
|
||||||
.select((eb) =>
|
.$call(withExif)
|
||||||
eb
|
.$call((qb) => withStack(qb, { assets: false }))
|
||||||
.selectFrom('asset_stack')
|
|
||||||
.select((eb) => eb.fn.countAll().as('stackedAssetsCount'))
|
|
||||||
.whereRef('asset_stack.id', '=', 'assets.stackId')
|
|
||||||
.as('stackedAssetsCount'),
|
|
||||||
)
|
|
||||||
.where('ownerId', '=', anyUuid(options.userIds))
|
.where('ownerId', '=', anyUuid(options.userIds))
|
||||||
.where('isVisible', '=', true)
|
.where('isVisible', '=', true)
|
||||||
.where('updatedAt', '>', options.updatedAfter)
|
.where('updatedAt', '>', options.updatedAfter)
|
||||||
|
|
Loading…
Reference in a new issue