fix: Tauri commands camelCase + PeopleView perPage
This commit is contained in:
@@ -74,7 +74,7 @@ struct SearchIdentityResult {
|
||||
const CORE_API: &str = "http://localhost:3002";
|
||||
const API_KEY: &str = "muser_68600856036340bcafc01930eb4bd839_1774418104_97221b69";
|
||||
|
||||
#[tauri::command]
|
||||
#[tauri::command(rename_all = "camelCase")]
|
||||
async fn search_llm_smart(query: String, limit: usize) -> Result<Vec<SearchResult>, String> {
|
||||
let client = reqwest::Client::new();
|
||||
let url = format!("{}/api/v1/search/llm-smart?api_key={}", CORE_API, API_KEY);
|
||||
@@ -116,7 +116,7 @@ struct GetFilesArgs {
|
||||
page_size: usize,
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tauri::command(rename_all = "camelCase")]
|
||||
async fn get_files(args: GetFilesArgs) -> Result<Vec<FileInfo>, String> {
|
||||
let page_size = args.page_size;
|
||||
let client = reqwest::Client::new();
|
||||
@@ -146,7 +146,7 @@ async fn get_files(args: GetFilesArgs) -> Result<Vec<FileInfo>, String> {
|
||||
Ok(files)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tauri::command(rename_all = "camelCase")]
|
||||
async fn get_people(page: usize, per_page: usize) -> Result<Vec<PersonInfo>, String> {
|
||||
eprintln!("[get_people] page={} per_page={}", page, per_page);
|
||||
let client = reqwest::Client::new();
|
||||
@@ -174,7 +174,7 @@ async fn get_people(page: usize, per_page: usize) -> Result<Vec<PersonInfo>, Str
|
||||
Ok(people)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tauri::command(rename_all = "camelCase")]
|
||||
async fn get_faces(uuid: String, per_page: usize) -> Result<Vec<FaceInfo>, String> {
|
||||
let client = reqwest::Client::new();
|
||||
let url = format!("{}/api/v1/identity/{}/faces?api_key={}&page_size={}", CORE_API, uuid, API_KEY, per_page);
|
||||
@@ -201,7 +201,7 @@ async fn get_faces(uuid: String, per_page: usize) -> Result<Vec<FaceInfo>, Strin
|
||||
Ok(faces)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tauri::command(rename_all = "camelCase")]
|
||||
async fn get_traces(uuid: String, per_page: usize) -> Result<Vec<TraceInfo>, String> {
|
||||
let client = reqwest::Client::new();
|
||||
let url = format!("{}/api/v1/identity/{}/traces?api_key={}&page_size={}", CORE_API, uuid, API_KEY, per_page);
|
||||
@@ -228,7 +228,7 @@ async fn get_traces(uuid: String, per_page: usize) -> Result<Vec<TraceInfo>, Str
|
||||
Ok(traces)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tauri::command(rename_all = "camelCase")]
|
||||
async fn get_thumbnail(uuid: String, frame: u32) -> Result<String, String> {
|
||||
let url = format!("{}/api/v1/file/{}/thumbnail?api_key={}&frame={}", CORE_API, uuid, API_KEY, frame);
|
||||
let bytes = reqwest::get(&url).await
|
||||
@@ -238,7 +238,7 @@ async fn get_thumbnail(uuid: String, frame: u32) -> Result<String, String> {
|
||||
Ok(format!("data:image/jpeg;base64,{}", STANDARD.encode(&bytes)))
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tauri::command(rename_all = "camelCase")]
|
||||
async fn get_video_stream(uuid: String, start_time: f64, end_time: f64) -> Result<String, String> {
|
||||
let url = format!("{}/api/v1/file/{}/video?api_key={}&start_time={}&end_time={}", CORE_API, uuid, API_KEY, start_time, end_time);
|
||||
let bytes = reqwest::get(&url).await
|
||||
@@ -259,7 +259,7 @@ const PROFILE_DIRS: &[&str] = &[
|
||||
"/Users/accusys/momentry/output_dev/identities",
|
||||
];
|
||||
|
||||
#[tauri::command]
|
||||
#[tauri::command(rename_all = "camelCase")]
|
||||
async fn get_identity_profile(uuid: String) -> Result<String, String> {
|
||||
let no_dash = uuid.replace('-', "");
|
||||
for dir in PROFILE_DIRS {
|
||||
@@ -277,7 +277,7 @@ async fn get_identity_profile(uuid: String) -> Result<String, String> {
|
||||
Err("Profile image not found".to_string())
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tauri::command(rename_all = "camelCase")]
|
||||
async fn update_identity_name(uuid: String, name: String) -> Result<(), String> {
|
||||
let client = reqwest::Client::new();
|
||||
let url = format!("{}/api/v1/identity/{}?api_key={}", CORE_API, uuid, API_KEY);
|
||||
@@ -291,7 +291,7 @@ async fn update_identity_name(uuid: String, name: String) -> Result<(), String>
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tauri::command(rename_all = "camelCase")]
|
||||
async fn delete_identity(uuid: String) -> Result<(), String> {
|
||||
let client = reqwest::Client::new();
|
||||
let url = format!("{}/api/v1/identity/{}?api_key={}", CORE_API, uuid, API_KEY);
|
||||
@@ -304,7 +304,7 @@ async fn delete_identity(uuid: String) -> Result<(), String> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tauri::command(rename_all = "camelCase")]
|
||||
async fn search_identities(query: String, limit: usize) -> Result<Vec<SearchIdentityResult>, String> {
|
||||
let client = reqwest::Client::new();
|
||||
let url = format!("{}/api/v1/identities/search?api_key={}&q={}", CORE_API, API_KEY, query);
|
||||
@@ -331,7 +331,7 @@ async fn search_identities(query: String, limit: usize) -> Result<Vec<SearchIden
|
||||
Ok(results)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tauri::command(rename_all = "camelCase")]
|
||||
async fn get_face_candidates(page: usize, per_page: usize) -> Result<Vec<FaceCandidate>, String> {
|
||||
let client = reqwest::Client::new();
|
||||
let url = format!("{}/api/v1/faces/candidates?api_key={}&page={}&page_size={}", CORE_API, API_KEY, page, per_page);
|
||||
@@ -354,7 +354,7 @@ async fn get_face_candidates(page: usize, per_page: usize) -> Result<Vec<FaceCan
|
||||
Ok(candidates)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tauri::command(rename_all = "camelCase")]
|
||||
async fn merge_identities(uuid: String, into_uuid: String) -> Result<(), String> {
|
||||
let client = reqwest::Client::new();
|
||||
let url = format!("{}/api/v1/identity/{}/mergeinto?api_key={}", CORE_API, uuid, API_KEY);
|
||||
@@ -368,7 +368,7 @@ async fn merge_identities(uuid: String, into_uuid: String) -> Result<(), String>
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tauri::command(rename_all = "camelCase")]
|
||||
async fn bind_face(uuid: String, face_id: String, file_uuid: String) -> Result<(), String> {
|
||||
let client = reqwest::Client::new();
|
||||
let url = format!("{}/api/v1/identity/{}/bind?api_key={}", CORE_API, uuid, API_KEY);
|
||||
@@ -382,7 +382,7 @@ async fn bind_face(uuid: String, face_id: String, file_uuid: String) -> Result<(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[tauri::command(rename_all = "camelCase")]
|
||||
async fn unbind_face(uuid: String, face_id: String, file_uuid: String) -> Result<(), String> {
|
||||
let client = reqwest::Client::new();
|
||||
let url = format!("{}/api/v1/identity/{}/unbind?api_key={}", CORE_API, uuid, API_KEY);
|
||||
|
||||
Reference in New Issue
Block a user