From 39082f62b642c6d4f7c690bd037ca242e31cd9d3 Mon Sep 17 00:00:00 2001 From: lanyeeee Date: Tue, 25 Aug 2026 10:31:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E4=BF=AE=E6=94=B9DownloadProgress=E5=90=8E=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E5=B7=B2=E5=AE=8C=E6=88=90=E4=BB=BB=E5=8A=A1=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E8=A2=AB=E5=9B=9E=E6=BB=9A=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-tauri/src/downloader/download_progress.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src-tauri/src/downloader/download_progress.rs b/src-tauri/src/downloader/download_progress.rs index f8d873a..33d9774 100644 --- a/src-tauri/src/downloader/download_progress.rs +++ b/src-tauri/src/downloader/download_progress.rs @@ -217,6 +217,9 @@ impl DownloadProgress { self.prepare(app).await.wrap_err("准备下载失败")?; + self.completed_ts = None; // 重置完成时间戳 + download_task.update_progress(|p| *p = self.clone()); + let progress_before_hook = self.clone(); app.get_plugin_manager() .run_hook(HookContext::AfterPrepare(AfterPrepareContext::new(self))) @@ -225,9 +228,6 @@ impl DownloadProgress { download_task.update_progress(|p| *p = self.clone()); } - self.completed_ts = None; // 重置完成时间戳 - download_task.update_progress(|p| *p = self.clone()); - std::fs::create_dir_all(&self.episode_dir) .wrap_err(format!("创建目录`{}`失败", self.episode_dir.display()))?; @@ -250,6 +250,7 @@ impl DownloadProgress { tracing::debug!("音频下载任务完成"); } + *self = download_task.progress.read().clone(); let progress_before_hook = self.clone(); app.get_plugin_manager() .run_hook(HookContext::BeforeVideoProcess( @@ -324,6 +325,7 @@ impl DownloadProgress { download_task.update_progress(|p| p.completed_ts = Some(completed_ts)); } + *self = download_task.progress.read().clone(); let progress_before_hook = self.clone(); app.get_plugin_manager() .run_hook(HookContext::OnCompleted(OnCompletedContext::new(self)))