docs: Update API, CHANGELOG, and ARCHITECTURE for Enhanced Anime Add Flow
This commit is contained in:
22
docs/API.md
22
docs/API.md
@@ -268,7 +268,7 @@ Source: [src/server/api/anime.py](../src/server/api/anime.py#L477-L495)
|
||||
|
||||
### POST /api/anime/add
|
||||
|
||||
Add a new series to the library.
|
||||
Add a new series to the library with automatic database persistence, folder creation, and episode scanning.
|
||||
|
||||
**Authentication:** Required
|
||||
|
||||
@@ -289,10 +289,28 @@ Add a new series to the library.
|
||||
"message": "Successfully added series: Attack on Titan",
|
||||
"key": "attack-on-titan",
|
||||
"folder": "Attack on Titan",
|
||||
"db_id": 1
|
||||
"db_id": 1,
|
||||
"missing_episodes": ["1-1", "1-2", "1-3"],
|
||||
"total_missing": 3
|
||||
}
|
||||
```
|
||||
|
||||
**Enhanced Flow:**
|
||||
|
||||
1. Validates the request (link format, name)
|
||||
2. Creates Serie object with sanitized folder name
|
||||
3. Saves to database via AnimeDBService
|
||||
4. Creates folder using sanitized display name (not internal key)
|
||||
5. Performs targeted episode scan for this anime only
|
||||
6. Returns response with missing episodes count
|
||||
|
||||
**Folder Name Sanitization:**
|
||||
|
||||
- Removes invalid filesystem characters: `< > : " / \ | ? *`
|
||||
- Trims leading/trailing whitespace and dots
|
||||
- Preserves Unicode characters (for Japanese titles)
|
||||
- Example: `"Attack on Titan: Final Season"` → `"Attack on Titan Final Season"`
|
||||
|
||||
Source: [src/server/api/anime.py](../src/server/api/anime.py#L604-L710)
|
||||
|
||||
### POST /api/anime/rescan
|
||||
|
||||
Reference in New Issue
Block a user