fixes for sync queries
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user