diff --git a/src-tauri/src/downloader.rs b/src-tauri/src/downloader.rs index ad78910..b9acb60 100644 --- a/src-tauri/src/downloader.rs +++ b/src-tauri/src/downloader.rs @@ -58,7 +58,7 @@ pub struct LogEvent { pub async fn fetch_metadata(app: &AppHandle, url: &str, parse_mix_playlist: bool) -> Result { app.emit("download-log", LogEvent { id: "Analysis".to_string(), - message: format!("Starting metadata fetch for URL: {}", url), + message: format!("正在为 URL: {} 获取元数据", url), level: "info".to_string(), }).ok(); @@ -93,7 +93,7 @@ pub async fn fetch_metadata(app: &AppHandle, url: &str, parse_mix_playlist: bool let stderr = String::from_utf8_lossy(&output.stderr); app.emit("download-log", LogEvent { id: "Analysis".to_string(), - message: format!("Metadata fetch failed: {}", stderr), + message: format!("元数据获取失败: {}", stderr), level: "error".to_string(), }).ok(); return Err(anyhow!("yt-dlp error: {}", stderr)); @@ -120,7 +120,7 @@ pub async fn fetch_metadata(app: &AppHandle, url: &str, parse_mix_playlist: bool app.emit("download-log", LogEvent { id: "Analysis".to_string(), - message: "Metadata fetch success (Playlist)".to_string(), + message: "元数据获取成功(播放列表)".to_string(), level: "info".to_string(), }).ok(); @@ -132,7 +132,7 @@ pub async fn fetch_metadata(app: &AppHandle, url: &str, parse_mix_playlist: bool let result = MetadataResult::Video(parse_video_metadata(&json)); app.emit("download-log", LogEvent { id: "Analysis".to_string(), - message: "Metadata fetch success (Video)".to_string(), + message: "元数据获取成功(视频)".to_string(), level: "info".to_string(), }).ok(); @@ -201,7 +201,7 @@ pub async fn download_video( let full_cmd_str = format!("{} {}", ytdlp_path.to_string_lossy(), args.join(" ")); app.emit("download-log", LogEvent { id: id.clone(), - message: format!("Executing command: {}", full_cmd_str), + message: format!("正在执行命令: {}", full_cmd_str), level: "info".to_string(), }).ok(); @@ -241,7 +241,7 @@ pub async fn download_video( app.emit("download-progress", ProgressEvent { id: id.clone(), progress: pct, - speed: "TODO".to_string(), + speed: "待定".to_string(), status: "downloading".to_string(), }).ok(); } @@ -276,7 +276,7 @@ pub async fn download_video( speed: "-".to_string(), status: "finished".to_string(), }).ok(); - Ok("Download complete".to_string()) + Ok("下载完成".to_string()) } else { app.emit("download-progress", ProgressEvent { id: id.clone(), @@ -284,6 +284,6 @@ pub async fn download_video( speed: "-".to_string(), status: "error".to_string(), }).ok(); - Err(anyhow!("Download process failed")) + Err(anyhow!("下载进程失败")) } } diff --git a/src/App.vue b/src/App.vue index fd05086..1deb4d7 100644 --- a/src/App.vue +++ b/src/App.vue @@ -23,7 +23,7 @@ onMounted(async () => {