polishing

This commit is contained in:
2026-05-06 10:53:27 -06:00
parent 09ebcbc9ec
commit fd6697b48e
18 changed files with 889 additions and 145 deletions

View File

@ -11,6 +11,7 @@ mod ai_provider;
mod caption_generator;
mod background_removal;
mod licensing;
mod models;
#[tauri::command]
fn get_projects_directory() -> Result<String, String> {
@ -207,6 +208,22 @@ async fn save_captions(content: String, output_path: String) -> Result<String, S
.map_err(|e| format!("Task error: {:?}", e))?
}
/// List downloaded models (Whisper + LLM) with sizes.
#[tauri::command]
fn list_models(app_handle: tauri::AppHandle) -> Result<Vec<models::ModelInfo>, String> {
let data_dir = app_handle
.path()
.app_data_dir()
.map_err(|e| format!("No app data directory: {e}"))?;
Ok(models::list_models(&data_dir))
}
/// Delete a downloaded model by path.
#[tauri::command]
fn delete_model(path: String) -> Result<(), String> {
models::delete_model(&path)
}
/// Get the combined app status: licensed, trial, or expired.
#[tauri::command]
fn get_app_status(app_handle: tauri::AppHandle) -> Result<licensing::AppStatus, String> {
@ -358,6 +375,8 @@ pub fn run() {
deactivate_license,
start_trial,
has_license_feature,
list_models,
delete_model,
])
.run(tauri::generate_context!())
.expect("error while running tauri application");