feat(server,web): favorite albums per user

This commit is contained in:
Alex
2026-04-23 03:33:32 +00:00
parent f0835d06f8
commit 166f36e5bf
17 changed files with 170 additions and 20 deletions
+23 -3
View File
@@ -1648,6 +1648,15 @@
"type": "string"
}
},
{
"name": "favorite",
"required": false,
"in": "query",
"description": "Filter to only albums favorited by the authenticated user",
"schema": {
"type": "boolean"
}
},
{
"name": "shared",
"required": false,
@@ -15324,6 +15333,10 @@
"description": "Activity feed enabled",
"type": "boolean"
},
"isFavorite": {
"description": "Whether the authenticated user has favorited this album",
"type": "boolean"
},
"lastModifiedAssetTimestamp": {
"description": "Last modified asset timestamp",
"format": "date-time",
@@ -15357,6 +15370,7 @@
"hasSharedLink",
"id",
"isActivityEnabled",
"isFavorite",
"shared",
"updatedAt"
],
@@ -22452,6 +22466,10 @@
"description": "Album ID",
"type": "string"
},
"isFavorite": {
"description": "Favorite flag",
"type": "boolean"
},
"role": {
"$ref": "#/components/schemas/AlbumUserRole"
},
@@ -22462,6 +22480,7 @@
},
"required": [
"albumId",
"isFavorite",
"role",
"userId"
],
@@ -25202,13 +25221,14 @@
},
"UpdateAlbumUserDto": {
"properties": {
"isFavorite": {
"description": "Mark album as favorite for the user (only the user themselves can update)",
"type": "boolean"
},
"role": {
"$ref": "#/components/schemas/AlbumUserRole"
}
},
"required": [
"role"
],
"type": "object"
},
"UpdateAssetDto": {
+10 -2
View File
@@ -474,6 +474,8 @@ export type AlbumResponseDto = {
id: string;
/** Activity feed enabled */
isActivityEnabled: boolean;
/** Whether the authenticated user has favorited this album */
isFavorite: boolean;
/** Last modified asset timestamp */
lastModifiedAssetTimestamp?: string;
order?: AssetOrder;
@@ -556,7 +558,9 @@ export type MapMarkerResponseDto = {
state: string | null;
};
export type UpdateAlbumUserDto = {
role: AlbumUserRole;
/** Mark album as favorite for the user (only the user themselves can update) */
isFavorite?: boolean;
role?: AlbumUserRole;
};
export type AlbumUserAddDto = {
/** Album user role */
@@ -2856,6 +2860,8 @@ export type SyncAlbumUserDeleteV1 = {
export type SyncAlbumUserV1 = {
/** Album ID */
albumId: string;
/** Favorite flag */
isFavorite: boolean;
role: AlbumUserRole;
/** User ID */
userId: string;
@@ -3619,8 +3625,9 @@ export function getUserStatisticsAdmin({ id, isFavorite, isTrashed, visibility }
/**
* List all albums
*/
export function getAllAlbums({ assetId, shared }: {
export function getAllAlbums({ assetId, favorite, shared }: {
assetId?: string;
favorite?: boolean;
shared?: boolean;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
@@ -3628,6 +3635,7 @@ export function getAllAlbums({ assetId, shared }: {
data: AlbumResponseDto[];
}>(`/albums${QS.query(QS.explode({
assetId,
favorite,
shared
}))}`, {
...opts