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