fix: scan status=unregistered not shown as registered; feat: config API for auto-pipeline/watcher-auto-register

This commit is contained in:
Accusys
2026-05-19 00:37:00 +08:00
parent 05e1e807c0
commit a02a83c1c3
9 changed files with 259 additions and 35 deletions

View File

@@ -11,7 +11,8 @@
Register a video file for processing. Returns the file's metadata and UUID.
**New in v0.1.2**: Registration now **automatically triggers the processing pipeline** — no need to call `POST /api/v1/file/:file_uuid/process` separately. The system will:
Registration can **automatically trigger the processing pipeline** if the
[auto-pipeline toggle](/api/v1/config/auto-pipeline) is enabled (disabled by default). The system will:
1. Register the file and run ffprobe
2. Auto-run offline TMDb probe (reads local identity files, no API calls)
3. Create a monitor job for the worker

View File

@@ -125,6 +125,59 @@ curl -s -X POST "$API/api/v1/config/cache" \
-d '{"enabled": false}'
```
### `POST /api/v1/config/auto-pipeline`
**Auth**: Required
**Scope**: system-level
Toggle automatic processing pipeline trigger on file registration (disabled by default).
#### Request Parameters
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `enabled` | boolean | Yes | `true` to enable auto-pipeline, `false` to disable |
#### Example
```bash
# Enable auto-pipeline
curl -s -X POST "$API/api/v1/config/auto-pipeline" \
-H "Content-Type: application/json" \
-H "X-API-Key: $KEY" \
-d '{"enabled": true}'
# Disable auto-pipeline
curl -s -X POST "$API/api/v1/config/auto-pipeline" \
-H "Content-Type: application/json" \
-H "X-API-Key: $KEY" \
-d '{"enabled": false}'
```
### `POST /api/v1/config/watcher-auto-register`
**Auth**: Required
**Scope**: system-level
Toggle automatic registration of newly detected files in the watcher (disabled by default).
When enabled, the file watcher automatically pre-processes and registers new files into the database.
#### Request Parameters
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `enabled` | boolean | Yes | `true` to enable watcher auto-register, `false` to disable |
#### Example
```bash
# Enable watcher auto-register
curl -s -X POST "$API/api/v1/config/watcher-auto-register" \
-H "Content-Type: application/json" \
-H "X-API-Key: $KEY" \
-d '{"enabled": true}'
```
### Unmounted Routes
The following routes are defined in source code but are **NOT** currently mounted in the router: