Skip to content

High performance self-hosted photo and video management solution.

fix: album performances (#5224)

martinc438e179543f
diff --git a/server/src/domain/album/album.service.ts b/server/src/domain/album/album.service.ts
index 8a66aaa33d..9033bcd1c6 100644
--- a/server/src/domain/album/album.service.ts
+++ b/server/src/domain/album/album.service.ts
@@ -81,7 +81,8 @@ export class AlbumService {
async get(authUser: AuthUserDto, id: string, dto: AlbumInfoDto): Promise<AlbumResponseDto> {
await this.access.requirePermission(authUser, Permission.ALBUM_READ, id);
await this.albumRepository.updateThumbnails();
- return mapAlbum(await this.findOrFail(id, { withAssets: true }), !dto.withoutAssets);
+ const withAssets = dto.withoutAssets === undefined ? true : !dto.withoutAssets;
+ return mapAlbum(await this.findOrFail(id, { withAssets }), !dto.withoutAssets);
}
async create(authUser: AuthUserDto, dto: CreateAlbumDto): Promise<AlbumResponseDto> {
diff --git a/server/src/infra/repositories/album.repository.ts b/server/src/infra/repositories/album.repository.ts
index 735b2d5849..c71ce1c38a 100644
--- a/server/src/infra/repositories/album.repository.ts
+++ b/server/src/infra/repositories/album.repository.ts
@@ -56,6 +56,7 @@ export class AlbumRepository implements IAlbumRepository {
],
relations: { owner: true, sharedUsers: true },
order: { createdAt: 'DESC' },
+ relationLoadStrategy: 'query',
});
}
@@ -91,6 +92,7 @@ export class AlbumRepository implements IAlbumRepository {
relations: { sharedUsers: true, sharedLinks: true, owner: true },
where: { ownerId },
order: { createdAt: 'DESC' },
+ relationLoadStrategy: 'query',
});
}
@@ -106,6 +108,7 @@ export class AlbumRepository implements IAlbumRepository {
{ ownerId, sharedUsers: { id: Not(IsNull()) } },
],
order: { createdAt: 'DESC' },
+ relationLoadStrategy: 'query',
});
}
@@ -117,6 +120,7 @@ export class AlbumRepository implements IAlbumRepository {
relations: { sharedUsers: true, sharedLinks: true, owner: true },
where: { ownerId, sharedUsers: { id: IsNull() }, sharedLinks: { id: IsNull() } },
order: { createdAt: 'DESC' },
+ relationLoadStrategy: 'query',
});
}