// filepath: src-tauri/src/lib.rs
mod binary_manager;
mod downloader;
mod storage;
mod commands;

#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
    tauri::Builder::default()
        .plugin(tauri_plugin_opener::init())
        .plugin(tauri_plugin_dialog::init())
        .invoke_handler(tauri::generate_handler![
            commands::init_ytdlp,
            commands::update_ytdlp,
            commands::update_quickjs,
            commands::update_ffmpeg,
            commands::get_ytdlp_version,
            commands::get_quickjs_version,
            commands::get_ffmpeg_version,
            commands::fetch_image,
            commands::fetch_metadata,
            commands::start_download,
            commands::get_settings,
            commands::save_settings,
            commands::get_history,
            commands::clear_history,
            commands::delete_history_item,
            commands::close_splash,
            commands::open_in_explorer
        ])
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}
