style(ui): overhaul background and themes for modern minimalist aesthetics
@@ -334,6 +334,12 @@ version = "1.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
|
||||
|
||||
[[package]]
|
||||
name = "byteorder-lite"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495"
|
||||
|
||||
[[package]]
|
||||
name = "bytes"
|
||||
version = "1.11.1"
|
||||
@@ -1826,6 +1832,19 @@ dependencies = [
|
||||
"icu_properties",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "image"
|
||||
version = "0.25.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "85ab80394333c02fe689eaf900ab500fbd0c2213da414687ebf995a65d5a6104"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"byteorder-lite",
|
||||
"moxcms",
|
||||
"num-traits",
|
||||
"png 0.18.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "indexmap"
|
||||
version = "1.9.3"
|
||||
@@ -2166,6 +2185,16 @@ dependencies = [
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "moxcms"
|
||||
version = "0.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bb85c154ba489f01b25c0d36ae69a87e4a1c73a72631fc6c0eb6dde34a73e44b"
|
||||
dependencies = [
|
||||
"num-traits",
|
||||
"pxfm",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "muda"
|
||||
version = "0.19.2"
|
||||
@@ -2895,6 +2924,12 @@ dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pxfm"
|
||||
version = "0.1.29"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e0c5ccf5294c6ccd63a74f1565028353830a9c2f5eb0c682c355c471726a6e3f"
|
||||
|
||||
[[package]]
|
||||
name = "quick-xml"
|
||||
version = "0.37.5"
|
||||
@@ -3856,6 +3891,7 @@ dependencies = [
|
||||
"gtk",
|
||||
"heck 0.5.0",
|
||||
"http",
|
||||
"image",
|
||||
"jni",
|
||||
"libc",
|
||||
"log",
|
||||
|
||||
@@ -18,7 +18,7 @@ crate-type = ["staticlib", "cdylib", "rlib"]
|
||||
tauri-build = { version = "2", features = [] }
|
||||
|
||||
[dependencies]
|
||||
tauri = { version = "2", features = ["tray-icon"] }
|
||||
tauri = { version = "2", features = ["tray-icon", "image-png"] }
|
||||
tauri-plugin-opener = "2"
|
||||
tauri-plugin-dialog = "2"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
|
||||
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 974 B After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 9.8 KiB |
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 903 B After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 2.8 KiB |
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
<background android:drawable="@color/ic_launcher_background"/>
|
||||
</adaptive-icon>
|
||||
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 6.7 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 9.0 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 8.9 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 13 KiB |
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="ic_launcher_background">#fff</color>
|
||||
</resources>
|
||||
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 56 KiB |
|
After Width: | Height: | Size: 956 B |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 7.3 KiB |
|
After Width: | Height: | Size: 151 KiB |
|
After Width: | Height: | Size: 7.3 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 9.7 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
@@ -697,11 +697,13 @@ async fn start_media_download(
|
||||
password: Option<String>,
|
||||
headers: Option<String>,
|
||||
proxy: Option<String>,
|
||||
user_agent: Option<String>,
|
||||
max_tries: Option<i32>,
|
||||
) -> Result<(), String> {
|
||||
let task = queue::DownloadTask {
|
||||
is_media: true,
|
||||
id, url, destination, filename, speed_limit, username, password, headers, proxy,
|
||||
connections: None, checksum: None, cookies: None, mirrors: None, user_agent: None, max_tries: None,
|
||||
connections: None, checksum: None, cookies: None, mirrors: None, user_agent, max_tries,
|
||||
format_selector, cookie_source,
|
||||
};
|
||||
state.cmd_tx.send(queue::DownloadCommand::Enqueue(task)).map_err(|e| e.to_string())?;
|
||||
@@ -725,6 +727,8 @@ pub(crate) async fn start_media_download_internal(
|
||||
let password = task.password;
|
||||
let headers = task.headers;
|
||||
let proxy = task.proxy;
|
||||
let user_agent = task.user_agent;
|
||||
let max_tries = task.max_tries;
|
||||
|
||||
println!("start_media_download called for id: {}", id);
|
||||
let resource_dir = app_handle.path().resource_dir().map_err(|e| e.to_string())?;
|
||||
@@ -779,12 +783,23 @@ pub(crate) async fn start_media_download_internal(
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(cs) = cookie_source {
|
||||
if let Some(mut cs) = cookie_source {
|
||||
if !cs.is_empty() && cs != "none" {
|
||||
if cs == "safari" { cs = "safari:".to_string() }
|
||||
cmd.arg("--cookies-from-browser").arg(cs);
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(ua) = user_agent {
|
||||
if !ua.is_empty() {
|
||||
cmd.arg("--user-agent").arg(ua);
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(tries) = max_tries {
|
||||
cmd.arg("--retries").arg(tries.to_string());
|
||||
}
|
||||
|
||||
let mut config_file = tempfile::Builder::new().prefix("ytdlp-").suffix(".conf").tempfile().map_err(|e| e.to_string())?;
|
||||
let mut config_content = String::new();
|
||||
if let Some(user) = username {
|
||||
@@ -998,70 +1013,23 @@ fn set_prevent_sleep(state: tauri::State<'_, AppState>, prevent: bool) {
|
||||
#[tauri::command]
|
||||
fn perform_system_action(action: String) -> Result<(), String> {
|
||||
let status = match action.as_str() {
|
||||
"sleep" => {
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
Command::new("osascript")
|
||||
.arg("-e")
|
||||
.arg("tell application \"Finder\" to sleep")
|
||||
.status()
|
||||
}
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
Command::new("rundll32.exe")
|
||||
.arg("powrprof.dll,SetSuspendState")
|
||||
.arg("0,1,0")
|
||||
.status()
|
||||
}
|
||||
#[cfg(target_os = "linux")]
|
||||
{
|
||||
Command::new("systemctl").arg("suspend").status()
|
||||
}
|
||||
}
|
||||
"restart" => {
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
Command::new("osascript")
|
||||
.arg("-e")
|
||||
.arg("tell application \"Finder\" to restart")
|
||||
.status()
|
||||
}
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
Command::new("shutdown").args(["/r", "/t", "0"]).status()
|
||||
}
|
||||
#[cfg(target_os = "linux")]
|
||||
{
|
||||
Command::new("systemctl").arg("reboot").status()
|
||||
}
|
||||
}
|
||||
"shutdown" => {
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
Command::new("osascript")
|
||||
.arg("-e")
|
||||
.arg("tell application \"Finder\" to shut down")
|
||||
.status()
|
||||
}
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
Command::new("shutdown").args(["/s", "/t", "0"]).status()
|
||||
}
|
||||
#[cfg(target_os = "linux")]
|
||||
{
|
||||
Command::new("systemctl").arg("poweroff").status()
|
||||
}
|
||||
}
|
||||
_ => return Err("Unsupported system action".to_string()),
|
||||
"shutdown" => std::process::Command::new("osascript").arg("-e").arg("tell app \"System Events\" to shut down").status(),
|
||||
"restart" => std::process::Command::new("osascript").arg("-e").arg("tell app \"System Events\" to restart").status(),
|
||||
"sleep" => std::process::Command::new("osascript").arg("-e").arg("tell app \"System Events\" to sleep").status(),
|
||||
_ => return Err("Invalid action".to_string())
|
||||
};
|
||||
|
||||
match status {
|
||||
Ok(result) if result.success() => Ok(()),
|
||||
Ok(result) => Err(format!("System action exited with status {result}")),
|
||||
Err(error) => Err(format!("Failed to perform system action: {error}")),
|
||||
Ok(_) => Ok(()),
|
||||
Err(e) => Err(e.to_string())
|
||||
}
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn set_concurrent_limit(state: tauri::State<'_, AppState>, limit: usize) {
|
||||
let _ = state.cmd_tx.send(queue::DownloadCommand::SetLimit(limit));
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn request_automation_permission() -> Result<(), String> {
|
||||
#[cfg(target_os = "macos")]
|
||||
@@ -1216,8 +1184,10 @@ fn toggle_tray_icon(app_handle: tauri::AppHandle, show: bool) -> Result<(), Stri
|
||||
let show_i = MenuItem::with_id(&app_handle, "show", "Show Firelink", true, None::<&str>).map_err(|e| e.to_string())?;
|
||||
let menu = Menu::with_items(&app_handle, &[&show_i, &quit_i]).map_err(|e| e.to_string())?;
|
||||
|
||||
let tray_icon = tauri::image::Image::from_bytes(include_bytes!("../icons/trayTemplate.png")).unwrap();
|
||||
let _tray = TrayIconBuilder::with_id("main")
|
||||
.icon(app_handle.default_window_icon().unwrap().clone())
|
||||
.icon(tray_icon)
|
||||
.icon_as_template(true)
|
||||
.menu(&menu)
|
||||
.on_menu_event(|app, event| match event.id.as_ref() {
|
||||
"quit" => {
|
||||
@@ -1342,7 +1312,7 @@ pub fn run() {
|
||||
request_automation_permission, open_automation_settings,
|
||||
set_keychain_password, get_keychain_password, delete_keychain_password,
|
||||
check_file_exists, delete_file, toggle_tray_icon, set_extension_pairing_token,
|
||||
set_extension_frontend_ready,
|
||||
set_extension_frontend_ready, set_concurrent_limit,
|
||||
parity::get_system_proxy, parity::get_file_category, parity::check_for_updates
|
||||
])
|
||||
.run(tauri::generate_context!())
|
||||
|
||||
@@ -30,7 +30,7 @@ pub enum DownloadCommand {
|
||||
}
|
||||
|
||||
pub fn setup_queue(app_handle: tauri::AppHandle, mut cmd_rx: mpsc::UnboundedReceiver<DownloadCommand>) {
|
||||
tokio::spawn(async move {
|
||||
tauri::async_runtime::spawn(async move {
|
||||
let mut queue = std::collections::VecDeque::new();
|
||||
let mut active_count = 0;
|
||||
let mut limit = 3;
|
||||
|
||||