feat: ffprobe for stream checking, drop overlay using webview

This commit is contained in:
2025-07-13 13:59:40 -05:00
parent 7fcb3e3f7c
commit 2e03281a79
9 changed files with 182 additions and 249 deletions

View File

@@ -1,14 +1,34 @@
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
use std::path::Path;
#[tauri::command]
fn greet(name: &str) -> String {
format!("Hello, {}! You've been greeted from Rust!", name)
fn has_streams(paths: Vec<String>) -> Result<Vec<bool>, String> {
let mut results = Vec::with_capacity(paths.len());
for path_str in paths {
let path = Path::new(&path_str);
if !path.is_file() {
results.push(false);
continue;
}
match ffprobe::ffprobe(&path_str) {
Ok(info) => {
dbg!(info);
results.push(true);
},
Err(err) => {
eprintln!("Could not analyze file with ffprobe: {:?}", err);
results.push(false);
}
}
}
Ok(results)
}
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
.plugin(tauri_plugin_opener::init())
.invoke_handler(tauri::generate_handler![greet])
.invoke_handler(tauri::generate_handler![has_streams])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}