feat(api): browse all media kinds, grouped search, delete media-items (#141, #161)

- Extend /api/library/browse to episodes, music videos, songs, other videos,
  images and remote streams (new LibraryBrowseMediaType values + hydrators);
  add optional Subtitle to LibraryBrowseItemResponseModel for leaf-item context
- Add GET /api/search: grouped per-kind results reusing the browse query/shape;
  empty query -> 422
- Add DELETE /api/media-items: body { ids }, empty -> 422, success -> 204
- Tests: SearchController, MediaItemsController, security + OpenAPI contract entries
- Regenerate openapi v1.json + web v1.d.ts

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-07 15:23:07 +02:00
co-authored by Claude Fable 5
parent e0f36a12fb
commit 6c68c291a0
16 changed files with 914 additions and 5 deletions
+232 -1
View File
@@ -3196,6 +3196,65 @@
}
}
},
"/api/media-items": {
"delete": {
"tags": [
"Media Items"
],
"summary": "Delete media items from the database",
"operationId": "DeleteMediaItems",
"requestBody": {
"content": {
"application/json-patch+json": {
"schema": {
"$ref": "#/components/schemas/DeleteMediaItemsRequest"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/DeleteMediaItemsRequest"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/DeleteMediaItemsRequest"
}
},
"application/*+json": {
"schema": {
"$ref": "#/components/schemas/DeleteMediaItemsRequest"
}
}
},
"required": true
},
"responses": {
"204": {
"description": "No Content"
},
"422": {
"description": "Unprocessable Entity",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
}
}
}
}
}
},
"/api/media-sources": {
"get": {
"tags": [
@@ -4619,6 +4678,76 @@
}
}
},
"/api/search": {
"get": {
"tags": [
"Search"
],
"summary": "Search library items across all media kinds",
"operationId": "Search",
"parameters": [
{
"name": "query",
"in": "query",
"schema": {
"type": "string",
"default": ""
}
},
{
"name": "pageSize",
"in": "query",
"schema": {
"type": "integer",
"format": "int32",
"default": 50
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/SearchResultsResponseModel"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/SearchResultsResponseModel"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/SearchResultsResponseModel"
}
}
}
},
"422": {
"description": "Unprocessable Entity",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
}
}
}
}
}
},
"/api/sessions": {
"get": {
"tags": [
@@ -8649,6 +8778,24 @@
}
}
},
"DeleteMediaItemsRequest": {
"required": [
"ids"
],
"type": "object",
"properties": {
"ids": {
"type": [
"null",
"array"
],
"items": {
"type": "integer",
"format": "int32"
}
}
}
},
"FFmpegFullProfileResponseModel": {
"required": [
"id",
@@ -9450,6 +9597,12 @@
"integer"
],
"format": "int32"
},
"subtitle": {
"type": [
"null",
"string"
]
}
}
},
@@ -9463,7 +9616,13 @@
"SmartCollection",
"MultiCollection",
"RerunCollection",
"Playlist"
"Playlist",
"Episode",
"MusicVideo",
"Song",
"OtherVideo",
"Image",
"RemoteStream"
],
"type": "string"
},
@@ -10887,6 +11046,72 @@
}
}
},
"SearchResultGroupResponseModel": {
"required": [
"totalCount",
"items"
],
"type": "object",
"properties": {
"totalCount": {
"type": "integer",
"format": "int32"
},
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/LibraryBrowseItemResponseModel"
}
}
}
},
"SearchResultsResponseModel": {
"required": [
"movies",
"shows",
"seasons",
"artists",
"episodes",
"musicVideos",
"songs",
"otherVideos",
"images",
"remoteStreams"
],
"type": "object",
"properties": {
"movies": {
"$ref": "#/components/schemas/SearchResultGroupResponseModel"
},
"shows": {
"$ref": "#/components/schemas/SearchResultGroupResponseModel"
},
"seasons": {
"$ref": "#/components/schemas/SearchResultGroupResponseModel"
},
"artists": {
"$ref": "#/components/schemas/SearchResultGroupResponseModel"
},
"episodes": {
"$ref": "#/components/schemas/SearchResultGroupResponseModel"
},
"musicVideos": {
"$ref": "#/components/schemas/SearchResultGroupResponseModel"
},
"songs": {
"$ref": "#/components/schemas/SearchResultGroupResponseModel"
},
"otherVideos": {
"$ref": "#/components/schemas/SearchResultGroupResponseModel"
},
"images": {
"$ref": "#/components/schemas/SearchResultGroupResponseModel"
},
"remoteStreams": {
"$ref": "#/components/schemas/SearchResultGroupResponseModel"
}
}
},
"SmartCollectionResponseModel": {
"required": [
"id",
@@ -12252,6 +12477,9 @@
{
"name": "Maintenance"
},
{
"name": "Media Items"
},
{
"name": "Media Sources"
},
@@ -12267,6 +12495,9 @@
{
"name": "Schedules"
},
{
"name": "Search"
},
{
"name": "Sessions"
},