Skip to content

High performance self-hosted photo and video management solution.

feat(server): include shared albums in getByAssetId (#3978)

Maarten Rijke26bc889f8db3
diff --git a/server/src/infra/repositories/album.repository.ts b/server/src/infra/repositories/album.repository.ts
index c59589710b..d370936710 100644
--- a/server/src/infra/repositories/album.repository.ts
+++ b/server/src/infra/repositories/album.repository.ts
@@ -50,7 +50,10 @@ export class AlbumRepository implements IAlbumRepository {
getByAssetId(ownerId: string, assetId: string): Promise<AlbumEntity[]> {
return this.repository.find({
- where: { ownerId, assets: { id: assetId } },
+ where: [
+ { ownerId, assets: { id: assetId } },
+ { sharedUsers: { id: ownerId }, assets: { id: assetId } },
+ ],
relations: { owner: true, sharedUsers: true },
order: { createdAt: 'DESC' },
});