mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
revert asset changes
This commit is contained in:
parent
f1390febf3
commit
0ee9cc6924
1 changed files with 2 additions and 84 deletions
|
|
@ -542,25 +542,6 @@ export class AssetRepository {
|
||||||
.$call(withExif)
|
.$call(withExif)
|
||||||
.$call(withDefaultVisibility)
|
.$call(withDefaultVisibility)
|
||||||
.where('ownerId', '=', anyUuid(userIds))
|
.where('ownerId', '=', anyUuid(userIds))
|
||||||
.$if(userIds.length > 1, (qb) =>
|
|
||||||
qb
|
|
||||||
.leftJoin('partner', (join) =>
|
|
||||||
join
|
|
||||||
.onRef('partner.sharedById', '=', 'asset.ownerId')
|
|
||||||
.on((eb) =>
|
|
||||||
eb.or(
|
|
||||||
userIds.map((uid) => eb('partner.sharedWithId', '=', uid))
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.where((eb) =>
|
|
||||||
eb.or([
|
|
||||||
eb('partner.startDate', 'is', null),
|
|
||||||
eb('partner.sharedById', 'is', null),
|
|
||||||
eb('asset.localDateTime', '>=', eb.ref('partner.startDate')),
|
|
||||||
])
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.where('deletedAt', 'is', null)
|
.where('deletedAt', 'is', null)
|
||||||
.orderBy((eb) => eb.fn('random'))
|
.orderBy((eb) => eb.fn('random'))
|
||||||
.limit(take)
|
.limit(take)
|
||||||
|
|
@ -591,29 +572,7 @@ export class AssetRepository {
|
||||||
)
|
)
|
||||||
.where((eb) => eb.or([eb('asset.stackId', 'is', null), eb(eb.table('stack'), 'is not', null)])),
|
.where((eb) => eb.or([eb('asset.stackId', 'is', null), eb(eb.table('stack'), 'is not', null)])),
|
||||||
)
|
)
|
||||||
.$if(!!options.userIds, (qb) =>
|
.$if(!!options.userIds, (qb) => qb.where('asset.ownerId', '=', anyUuid(options.userIds!)))
|
||||||
qb
|
|
||||||
.where('asset.ownerId', '=', anyUuid(options.userIds!))
|
|
||||||
.$if(options.userIds!.length > 1, (qb2) =>
|
|
||||||
qb2
|
|
||||||
.leftJoin('partner', (join) =>
|
|
||||||
join
|
|
||||||
.onRef('partner.sharedById', '=', 'asset.ownerId')
|
|
||||||
.on((eb) =>
|
|
||||||
eb.or(
|
|
||||||
options.userIds!.map((uid) => eb('partner.sharedWithId', '=', uid))
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.where((eb) =>
|
|
||||||
eb.or([
|
|
||||||
eb('partner.startDate', 'is', null),
|
|
||||||
eb('partner.sharedById', 'is', null),
|
|
||||||
eb('asset.localDateTime', '>=', eb.ref('partner.startDate')),
|
|
||||||
])
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.$if(options.isFavorite !== undefined, (qb) => qb.where('asset.isFavorite', '=', options.isFavorite!))
|
.$if(options.isFavorite !== undefined, (qb) => qb.where('asset.isFavorite', '=', options.isFavorite!))
|
||||||
.$if(!!options.assetType, (qb) => qb.where('asset.type', '=', options.assetType!))
|
.$if(!!options.assetType, (qb) => qb.where('asset.type', '=', options.assetType!))
|
||||||
.$if(options.isDuplicate !== undefined, (qb) =>
|
.$if(options.isDuplicate !== undefined, (qb) =>
|
||||||
|
|
@ -686,29 +645,7 @@ export class AssetRepository {
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.$if(!!options.personId, (qb) => hasPeople(qb, [options.personId!]))
|
.$if(!!options.personId, (qb) => hasPeople(qb, [options.personId!]))
|
||||||
.$if(!!options.userIds, (qb) =>
|
.$if(!!options.userIds, (qb) => qb.where('asset.ownerId', '=', anyUuid(options.userIds!)))
|
||||||
qb
|
|
||||||
.where('asset.ownerId', '=', anyUuid(options.userIds!))
|
|
||||||
.$if(options.userIds!.length > 1, (qb2) =>
|
|
||||||
qb2
|
|
||||||
.leftJoin('partner', (join) =>
|
|
||||||
join
|
|
||||||
.onRef('partner.sharedById', '=', 'asset.ownerId')
|
|
||||||
.on((eb) =>
|
|
||||||
eb.or(
|
|
||||||
options.userIds!.map((uid) => eb('partner.sharedWithId', '=', uid))
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.where((eb) =>
|
|
||||||
eb.or([
|
|
||||||
eb('partner.startDate', 'is', null),
|
|
||||||
eb('partner.sharedById', 'is', null),
|
|
||||||
eb('asset.localDateTime', '>=', eb.ref('partner.startDate')),
|
|
||||||
])
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.$if(options.isFavorite !== undefined, (qb) => qb.where('asset.isFavorite', '=', options.isFavorite!))
|
.$if(options.isFavorite !== undefined, (qb) => qb.where('asset.isFavorite', '=', options.isFavorite!))
|
||||||
.$if(!!options.withStacked, (qb) =>
|
.$if(!!options.withStacked, (qb) =>
|
||||||
qb
|
qb
|
||||||
|
|
@ -867,25 +804,6 @@ export class AssetRepository {
|
||||||
)
|
)
|
||||||
.select((eb) => eb.fn.toJson(eb.table('stacked_assets').$castTo<Stack | null>()).as('stack'))
|
.select((eb) => eb.fn.toJson(eb.table('stacked_assets').$castTo<Stack | null>()).as('stack'))
|
||||||
.where('asset.ownerId', '=', anyUuid(options.userIds))
|
.where('asset.ownerId', '=', anyUuid(options.userIds))
|
||||||
.$if(options.userIds.length > 1, (qb) =>
|
|
||||||
qb
|
|
||||||
.leftJoin('partner', (join) =>
|
|
||||||
join
|
|
||||||
.onRef('partner.sharedById', '=', 'asset.ownerId')
|
|
||||||
.on((eb) =>
|
|
||||||
eb.or(
|
|
||||||
options.userIds.map((uid) => eb('partner.sharedWithId', '=', uid))
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.where((eb) =>
|
|
||||||
eb.or([
|
|
||||||
eb('partner.startDate', 'is', null),
|
|
||||||
eb('partner.sharedById', 'is', null),
|
|
||||||
eb('asset.localDateTime', '>=', eb.ref('partner.startDate')),
|
|
||||||
])
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.where('asset.visibility', '!=', AssetVisibility.Hidden)
|
.where('asset.visibility', '!=', AssetVisibility.Hidden)
|
||||||
.where('asset.updatedAt', '>', options.updatedAfter)
|
.where('asset.updatedAt', '>', options.updatedAfter)
|
||||||
.limit(options.limit)
|
.limit(options.limit)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue