feat(settings): add button to open app data folder

This commit is contained in:
2025-10-05 00:17:33 -04:00
parent 8fb27b1acd
commit ca5f79b23a
9 changed files with 122 additions and 24 deletions

View File

@@ -1,8 +1,8 @@
use tauri_plugin_sql::{Migration, MigrationKind};
mod tagger;
mod metadata;
mod deezer_crypto;
mod metadata;
mod tagger;
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
#[tauri::command]
@@ -58,10 +58,10 @@ async fn download_and_decrypt_track(
is_encrypted: bool,
window: tauri::Window,
) -> Result<(), String> {
use tokio::io::AsyncWriteExt;
use tokio::fs::File;
use deezer_crypto::StreamingDecryptor;
use tauri::Emitter;
use tokio::fs::File;
use tokio::io::AsyncWriteExt;
// Build HTTP client
let client = reqwest::Client::builder()
@@ -117,11 +117,14 @@ async fn download_and_decrypt_track(
if rounded_percentage > last_reported_percentage || percentage == 100 {
last_reported_percentage = rounded_percentage;
let _ = window.emit("download-progress", serde_json::json!({
"downloaded": downloaded_bytes,
"total": total_size as u64,
"percentage": percentage
}));
let _ = window.emit(
"download-progress",
serde_json::json!({
"downloaded": downloaded_bytes,
"total": total_size as u64,
"percentage": percentage
}),
);
}
}
}
@@ -154,11 +157,14 @@ async fn download_and_decrypt_track(
if rounded_percentage > last_reported_percentage || percentage == 100 {
last_reported_percentage = rounded_percentage;
let _ = window.emit("download-progress", serde_json::json!({
"downloaded": downloaded_bytes,
"total": total_size as u64,
"percentage": percentage
}));
let _ = window.emit(
"download-progress",
serde_json::json!({
"downloaded": downloaded_bytes,
"total": total_size as u64,
"percentage": percentage
}),
);
}
}
}
@@ -293,6 +299,7 @@ pub fn run() {
}];
tauri::Builder::default()
.plugin(tauri_plugin_os::init())
.plugin(tauri_plugin_process::init())
.plugin(
tauri_plugin_sql::Builder::new()