mirror of
https://github.com/KevinMidboe/immich.git
synced 2026-01-27 03:26:31 +00:00
chore(server) Add user FK to album entity (#1569)
This commit is contained in:
@@ -13,7 +13,7 @@ export class AlbumResponseDto {
|
||||
shared!: boolean;
|
||||
sharedUsers!: UserResponseDto[];
|
||||
assets!: AssetResponseDto[];
|
||||
|
||||
owner?: UserResponseDto;
|
||||
@ApiProperty({ type: 'integer' })
|
||||
assetCount!: number;
|
||||
}
|
||||
@@ -27,6 +27,7 @@ export function mapAlbum(entity: AlbumEntity): AlbumResponseDto {
|
||||
sharedUsers.push(user);
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
albumName: entity.albumName,
|
||||
albumThumbnailAssetId: entity.albumThumbnailAssetId,
|
||||
@@ -34,6 +35,7 @@ export function mapAlbum(entity: AlbumEntity): AlbumResponseDto {
|
||||
updatedAt: entity.updatedAt,
|
||||
id: entity.id,
|
||||
ownerId: entity.ownerId,
|
||||
owner: entity.owner ? mapUser(entity.owner) : undefined,
|
||||
sharedUsers,
|
||||
shared: sharedUsers.length > 0 || entity.sharedLinks?.length > 0,
|
||||
assets: entity.assets?.map((assetAlbum) => mapAsset(assetAlbum.assetInfo)) || [],
|
||||
@@ -50,6 +52,7 @@ export function mapAlbumExcludeAssetInfo(entity: AlbumEntity): AlbumResponseDto
|
||||
sharedUsers.push(user);
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
albumName: entity.albumName,
|
||||
albumThumbnailAssetId: entity.albumThumbnailAssetId,
|
||||
@@ -57,6 +60,7 @@ export function mapAlbumExcludeAssetInfo(entity: AlbumEntity): AlbumResponseDto
|
||||
updatedAt: entity.updatedAt,
|
||||
id: entity.id,
|
||||
ownerId: entity.ownerId,
|
||||
owner: entity.owner ? mapUser(entity.owner) : undefined,
|
||||
sharedUsers,
|
||||
shared: sharedUsers.length > 0 || entity.sharedLinks?.length > 0,
|
||||
assets: [],
|
||||
|
||||
Reference in New Issue
Block a user