feat(server)!: add owned filter to albums API

BREAKING CHANGE: GET /albums with no parameters now returns all accessible albums (owned + shared-with-me) instead of only owned albums.
This commit is contained in:
timonrieger
2026-05-03 16:26:26 +02:00
parent 3decc864b5
commit 7d8be12330
8 changed files with 246 additions and 19 deletions
+11 -2
View File
@@ -1641,18 +1641,27 @@
"name": "assetId",
"required": false,
"in": "query",
"description": "Filter albums containing this asset ID (ignores shared parameter)",
"description": "Filter albums containing this asset ID (ignores other parameters)",
"schema": {
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
"type": "string"
}
},
{
"name": "owned",
"required": false,
"in": "query",
"description": "Filter by ownership: true = only owned, false = only shared-with-me, undefined = no filter",
"schema": {
"type": "boolean"
}
},
{
"name": "shared",
"required": false,
"in": "query",
"description": "Filter by shared status: true = only shared, false = not shared, undefined = all owned albums",
"description": "Filter by shared status: true = only shared, false = not shared, undefined = no filter",
"schema": {
"type": "boolean"
}
+3 -1
View File
@@ -3657,8 +3657,9 @@ export function getUserStatisticsAdmin({ id, isFavorite, isTrashed, visibility }
/**
* List all albums
*/
export function getAllAlbums({ assetId, shared }: {
export function getAllAlbums({ assetId, owned, shared }: {
assetId?: string;
owned?: boolean;
shared?: boolean;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
@@ -3666,6 +3667,7 @@ export function getAllAlbums({ assetId, shared }: {
data: AlbumResponseDto[];
}>(`/albums${QS.query(QS.explode({
assetId,
owned,
shared
}))}`, {
...opts