diff --git a/docs_v1.0/API_V1.0.0/API_DICTIONARY_V1.0.0.md b/docs_v1.0/API_V1.0.0/API_DICTIONARY_V1.0.0.md index 2450c41..000d0bf 100644 --- a/docs_v1.0/API_V1.0.0/API_DICTIONARY_V1.0.0.md +++ b/docs_v1.0/API_V1.0.0/API_DICTIONARY_V1.0.0.md @@ -61,7 +61,7 @@ Every path segment after the resource ID is a **verb** — an action on that res | 6 | GET | `/api/v1/stats/sftpgo` | SFTPGo service status | | 7 | GET | `/api/v1/stats/inference` | LLM/embedding health | | 8 | POST | `/api/v1/files/register` | Register video file → file_uuid | -| 9 | POST | `/api/v1/unregister` | Unregister file(s): by `uuid` or pattern match on `file_path`+`pattern` | +| 9 | POST | `/api/v1/unregister` | Unregister file(s): by `file_uuid` or pattern match on `file_path`+`pattern` | | 10 | GET | `/api/v1/files/scan` | Scan directory for new files | | 11 | GET | `/api/v1/file/:file_uuid/probe` | ffprobe metadata | | 12 | POST | `/api/v1/file/:file_uuid/process` | Start processing pipeline | diff --git a/docs_v1.0/API_V1.0.0/API_REFERENCE_V1.0.0.md b/docs_v1.0/API_V1.0.0/API_REFERENCE_V1.0.0.md index 74deb3b..f6adafb 100644 --- a/docs_v1.0/API_V1.0.0/API_REFERENCE_V1.0.0.md +++ b/docs_v1.0/API_V1.0.0/API_REFERENCE_V1.0.0.md @@ -118,10 +118,10 @@ Modes: - By `file_path` + `pattern` regex: unregister all matching files in a directory ```bash -# By UUID +# By file_uuid curl -X POST http://localhost:3002/api/v1/unregister \ -H "X-API-Key: muser_..." -H "Content-Type: application/json" \ - -d '{"uuid":"53e3a229bf68878b7a799e811e097f9c"}' + -d '{"file_uuid":"53e3a229bf68878b7a799e811e097f9c"}' # By pattern (unregister all .mp4 files in directory) curl -X POST http://localhost:3002/api/v1/unregister \ @@ -129,7 +129,7 @@ curl -X POST http://localhost:3002/api/v1/unregister \ -d '{"file_path":"/data/demo","pattern":"\\.mp4$"}' ``` ```json -{"success":true,"uuid":"53e3a229bf68878b7a799e811e097f9c","message":"File unregistered successfully"} +{"success":true,"file_uuid":"53e3a229bf68878b7a799e811e097f9c","message":"File unregistered successfully"} ``` ```bash diff --git a/src/api/server.rs b/src/api/server.rs index 35cf9c3..1862ab0 100644 --- a/src/api/server.rs +++ b/src/api/server.rs @@ -2507,13 +2507,13 @@ async fn cache_toggle( #[derive(Debug, Serialize)] struct UnregisterResponse { success: bool, - uuid: String, + file_uuid: String, message: String, } #[derive(Debug, Deserialize)] struct UnregisterRequest { - uuid: Option, + file_uuid: Option, file_path: Option, pattern: Option, } @@ -2530,7 +2530,7 @@ async fn unregister( if !dir.is_dir() { return Ok(Json(UnregisterResponse { success: false, - uuid: String::new(), + file_uuid: String::new(), message: format!("Not a directory: {}", dir_path), })); } @@ -2561,18 +2561,18 @@ async fn unregister( let _ = state.mongo_cache.invalidate_videos_list().await; return Ok(Json(UnregisterResponse { success: true, - uuid: format!("batch_{}", count), + file_uuid: format!("batch_{}", count), message: format!("Unregistered {} files matching pattern", count), })); } // Single UUID mode - let uuid = req.uuid.as_deref().unwrap_or(""); + let uuid = req.file_uuid.as_deref().unwrap_or(""); if uuid.is_empty() { return Ok(Json(UnregisterResponse { success: false, - uuid: String::new(), - message: "Either uuid or file_path+pattern is required".to_string(), + file_uuid: String::new(), + message: "Either file_uuid or file_path+pattern is required".to_string(), })); } @@ -2582,7 +2582,7 @@ async fn unregister( let _ = state.mongo_cache.invalidate_videos_list().await; Ok(Json(UnregisterResponse { success: true, - uuid: uuid.to_string(), + file_uuid: uuid.to_string(), message: "File unregistered successfully".to_string(), })) }