mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
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:
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user