diff --git a/server/src/repositories/asset.repository.ts b/server/src/repositories/asset.repository.ts index af5239ed70..b624bfe92b 100644 --- a/server/src/repositories/asset.repository.ts +++ b/server/src/repositories/asset.repository.ts @@ -443,8 +443,6 @@ export class AssetRepository { .$call((qb) => qb.select(withFacesAndPeople)) .executeTakeFirst(); } - - return this.getById(asset.id, { exifInfo: true, faces: { person: true } }); } async remove(asset: { id: string }): Promise { diff --git a/server/src/repositories/trash.repository.ts b/server/src/repositories/trash.repository.ts index 69507b1d58..c352d5cd54 100644 --- a/server/src/repositories/trash.repository.ts +++ b/server/src/repositories/trash.repository.ts @@ -11,6 +11,16 @@ export class TrashRepository { return this.db.selectFrom('assets').select(['id']).where('status', '=', AssetStatus.DELETED).stream(); } + @GenerateSql({ params: [DummyValue.UUID] }) + getTrashedIds(userId: string): AsyncIterableIterator<{ id: string }> { + return this.db + .selectFrom('assets') + .select(['id']) + .where('ownerId', '=', userId) + .where('status', '=', AssetStatus.TRASHED) + .stream(); + } + @GenerateSql({ params: [DummyValue.UUID] }) async restore(userId: string): Promise { const { numUpdatedRows } = await this.db