0.14.0-4 Merger
Deploy Docs to GitHub Pages / Build Documentation (push) Has been cancelled
Deploy Docs to GitHub Pages / Deploy to GitHub Pages (push) Has been cancelled

This commit is contained in:
2026-04-21 14:27:07 +00:00
parent caf6a638f7
commit c27a81cdb1
127 changed files with 10643 additions and 335 deletions
+75 -67
View File
@@ -1,27 +1,31 @@
# History API
Endpunkte für Job-Historie, Orphan-Import und Löschoperationen.
Endpunkte für Job-Historie, Metadaten-Nachpflege, Orphan-Import und Löschoperationen.
---
## GET /api/history
Liefert Jobs (optionale Filter).
Liefert Jobs mit optionalen Filtern.
**Query-Parameter:**
| Parameter | Typ | Beschreibung |
|----------|-----|-------------|
| `status` | string | Filter nach Job-Status |
| `search` | string | Suche in Titel-Feldern |
| `status` | string | Einzelstatus-Filter (legacy-kompatibel). |
| `statuses` | string | Mehrfachstatus als CSV, z. B. `FINISHED,ERROR`. |
| `search` | string | Suche in Titel-/IMDb-Feldern. |
| `limit` | number | Maximale Anzahl Ergebnisse. |
| `lite` | bool | Ohne Dateisystem-Checks (schneller). |
| `includeChildren` | bool | Child-Jobs (z. B. Serien-/Multipart-Kinder) explizit einbeziehen. |
**Beispiel:**
```text
GET /api/history?status=FINISHED&search=Inception
GET /api/history?statuses=FINISHED,ERROR&search=Inception&limit=50&lite=1
```
**Response:**
**Response (Beispiel):**
```json
{
@@ -30,6 +34,7 @@ GET /api/history?status=FINISHED&search=Inception
"id": 42,
"status": "FINISHED",
"title": "Inception",
"job_kind": "bluray",
"raw_path": "/mnt/raw/Inception - RAW - job-42",
"output_path": "/mnt/movies/Inception (2010)/Inception (2010).mkv",
"mediaType": "bluray",
@@ -52,12 +57,13 @@ Liefert Job-Detail.
| Parameter | Typ | Standard | Beschreibung |
|----------|-----|---------|-------------|
| `includeLogs` | bool | `false` | Prozesslog laden |
| `includeLiveLog` | bool | `false` | alias-artig ebenfalls Prozesslog laden |
| `includeAllLogs` | bool | `false` | vollständiges Log statt Tail |
| `logTailLines` | number | `800` | Tail-Länge falls nicht `includeAllLogs` |
| `includeLogs` | bool | `false` | Prozesslog laden. |
| `includeLiveLog` | bool | `false` | Live-/Tail-Log laden. |
| `includeAllLogs` | bool | `false` | vollständiges Log statt Tail. |
| `logTailLines` | number | `800` | Tail-Länge falls nicht `includeAllLogs`. |
| `lite` | bool | `false` | Detailantwort ohne FS-Checks. |
**Response:**
**Response (Beispiel):**
```json
{
@@ -86,33 +92,9 @@ Liefert Job-Detail.
Sucht RAW-Ordner ohne zugehörigen Job.
**Response:**
```json
{
"rawDir": "/mnt/raw",
"rawDirs": ["/mnt/raw", "/mnt/raw-bluray"],
"rows": [
{
"rawPath": "/mnt/raw/Inception (2010) [tt1375666] - RAW - job-99",
"folderName": "Inception (2010) [tt1375666] - RAW - job-99",
"title": "Inception",
"year": 2010,
"imdbId": "tt1375666",
"folderJobId": 99,
"entryCount": 4,
"hasBlurayStructure": true,
"lastModifiedAt": "2026-03-10T09:00:00.000Z"
}
]
}
```
---
## POST /api/history/orphan-raw/import
Importiert RAW-Ordner als FINISHED-Job.
Importiert einen RAW-Ordner als Job und triggert optional die Analyse des Imports.
**Request:**
@@ -120,12 +102,13 @@ Importiert RAW-Ordner als FINISHED-Job.
{ "rawPath": "/mnt/raw/Inception (2010) [tt1375666] - RAW - job-99" }
```
**Response:**
**Response (Beispiel):**
```json
{
"job": { "id": 77, "status": "FINISHED" },
"uiReset": { "reset": true, "state": "IDLE" }
"activation": { "started": true },
"activationError": null
}
```
@@ -133,26 +116,43 @@ Importiert RAW-Ordner als FINISHED-Job.
## POST /api/history/:id/omdb/assign
Weist OMDb-/Metadaten nachträglich zu.
Weist OMDb-/Filmdaten nachträglich zu.
**Request:**
## POST /api/history/:id/cd/assign
Weist CD-Metadaten (z. B. MusicBrainz) nachträglich zu.
## POST /api/history/:id/error/ack
Quittiert einen Fehlerzustand im Historieneintrag.
---
## GET /api/history/:id/delete-preview
Liefert eine Vorschau der löschbaren Pfade (inkl. Scope auf verknüpfte Jobs).
**Query-Parameter:**
| Parameter | Typ | Standard | Beschreibung |
|----------|-----|---------|-------------|
| `includeRelated` | bool | `true` | Verknüpfte Jobs in die Vorschau einbeziehen. |
**Response (Beispiel):**
```json
{
"imdbId": "tt1375666",
"title": "Inception",
"year": 2010,
"poster": "https://...",
"fromOmdb": true
"preview": {
"jobId": 42,
"relatedJobs": [{ "id": 42 }, { "id": 73 }],
"pathCandidates": {
"raw": [{ "path": "/mnt/raw/...", "exists": true, "isDirectory": true }],
"movie": [{ "path": "/mnt/movies/...", "exists": true, "isDirectory": true }]
}
}
}
```
**Response:**
```json
{ "job": { "id": 42, "imdb_id": "tt1375666" } }
```
---
## POST /api/history/:id/delete-files
@@ -162,23 +162,17 @@ Löscht Dateien eines Jobs, behält DB-Eintrag.
**Request:**
```json
{ "target": "both" }
{
"target": "both",
"includeRelated": true,
"selectedRawPaths": ["/mnt/raw/Inception - RAW - Disc1"],
"selectedMoviePaths": ["/mnt/movies/Inception (2010)"]
}
```
`target`: `raw` | `movie` | `both`
**Response:**
```json
{
"summary": {
"target": "both",
"raw": { "attempted": true, "deleted": true, "filesDeleted": 12, "dirsRemoved": 3, "reason": null },
"movie": { "attempted": true, "deleted": false, "filesDeleted": 0, "dirsRemoved": 0, "reason": "Movie-Datei/Pfad existiert nicht." }
},
"job": { "id": 42 }
}
```
`selectedRawPaths` / `selectedMoviePaths` sind optional und begrenzen die Löschung auf ausgewählte Pfade aus der Vorschau.
---
@@ -189,12 +183,20 @@ Löscht Job aus DB; optional auch Dateien.
**Request:**
```json
{ "target": "none" }
{
"target": "both",
"includeRelated": true,
"resetDriveState": false,
"keepDetectedDevice": true,
"preserveRawForImportJobs": false,
"selectedRawPaths": ["/mnt/raw/Inception - RAW - Disc1"],
"selectedMoviePaths": ["/mnt/movies/Inception (2010)"]
}
```
`target`: `none` | `raw` | `movie` | `both`
**Response:**
**Response (Beispiel):**
```json
{
@@ -209,6 +211,11 @@ Löscht Job aus DB; optional auch Dateien.
"uiReset": {
"reset": true,
"state": "IDLE"
},
"safeguards": {
"containsOrphanRawImportJob": false,
"resetDriveStateApplied": false,
"keepDetectedDeviceApplied": true
}
}
```
@@ -218,4 +225,5 @@ Löscht Job aus DB; optional auch Dateien.
## Hinweise
- Ein aktiver Pipeline-Job kann nicht gelöscht werden (`409`).
- Alle Löschoperationen sind irreversibel.
- Löschoperationen sind irreversibel.
- Bei Serien-/Multipart-Containern steuern `includeRelated` und Pfadselektionen den genauen Scope.