From 2299cf788b8a35e5bf05ebbf1352e91bd9c43c8f Mon Sep 17 00:00:00 2001 From: AniWorld Dev Date: Fri, 4 Sep 2026 19:14:48 +0200 Subject: [PATCH] docs(api): update GET /api/nfo/{key}/content entry to match the restored endpoint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The API reference for the 'View NFO XML' endpoint was written for the pre-refactor route shape (/api/nfo/{serie_id}/content with {serie_id, serie_folder, ...} response fields) that was removed in the NFO refactor (commits 21af502, a8e5487). The previous fix (9f52ea0) re-introduced the endpoint as /api/nfo/{key}/content with {key, folder, ...} response fields, but the docs still described the old, non-existent shape — anyone reading the API reference and trying to integrate would have hit a field-name mismatch. Update the entry in Docs/API.md: - Path parameter: serie_id -> key (matches the actual route and the convention used by the other NFO endpoints in the same file). - Response fields: serie_id/serie_folder -> key/folder. - Errors: add 400 (no folder), 500 (file read), 503 (anime_directory not configured) — matching what the handler actually raises. - Source link: point at the new line range in src/server/api/nfo.py. Scope: only the /content entry. The surrounding /api/nfo/{serie_id}/* block still describes other legacy endpoints that were removed in the same refactor — left untouched per 'only the last added endpoint'. --- Docs/API.md | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/Docs/API.md b/Docs/API.md index 553822e..a2ddea5 100644 --- a/Docs/API.md +++ b/Docs/API.md @@ -1056,34 +1056,39 @@ Update existing NFO file with fresh TMDB data. Source: [src/server/api/nfo.py](../src/server/api/nfo.py#L243-L325) -### GET /api/nfo/{serie_id}/content +### GET /api/nfo/{key}/content -Get NFO file XML content for a series. +Read the raw `tvshow.nfo` XML for a series. Used by the Anime Settings +page's "View NFO XML" button to render the on-disk NFO in a `
` block.
 
 **Authentication:** Required
 
 **Path Parameters:**
 
-- `serie_id` (string): Series identifier
+- `key` (string): Series unique key (e.g., `attack-on-titan`)
 
-**Response (200 OK):**
+**Response (200 OK):** [`NfoContentResponse`](../src/server/models/nfo.py)
 
 ```json
 {
-    "serie_id": "one-piece",
-    "serie_folder": "One Piece (1999)",
+    "key": "attack-on-titan",
+    "folder": "Attack on Titan (2013)",
     "content": "\n...",
     "file_size": 2048,
-    "last_modified": "2026-01-15T10:30:00"
+    "last_modified": "2026-09-04T17:42:13"
 }
 ```
 
 **Errors:**
 
-- `401 Unauthorized` - Not authenticated
-- `404 Not Found` - Series or NFO not found
+- `400 Bad Request` — Series has no folder configured.
+- `401 Unauthorized` — Not authenticated.
+- `404 Not Found` — Series with the given key does not exist, or its
+  `tvshow.nfo` is missing on disk.
+- `500 Internal Server Error` — Failed to read the NFO file from disk.
+- `503 Service Unavailable` — `settings.anime_directory` is not configured.
 
-Source: [src/server/api/nfo.py](../src/server/api/nfo.py#L328-L397)
+Source: [src/server/api/nfo.py](../src/server/api/nfo.py#L411-L477)
 
 ### GET /api/nfo/{serie_id}/media/status