From 21599d091b81f521db79824358948d807d1752bc Mon Sep 17 00:00:00 2001 From: vagabondHustler Date: Sun, 21 Jul 2024 14:29:27 +0200 Subject: [PATCH] Fix downloaded message in summary toast --- src/subsearch/core.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/subsearch/core.py b/src/subsearch/core.py index 0ea99eb1..cb8aa082 100644 --- a/src/subsearch/core.py +++ b/src/subsearch/core.py @@ -151,7 +151,7 @@ def download_manager(self) -> None: log.brackets(f"Download Manager") subtitles = self.rejected_subtitles + self.accepted_subtitles screen_manager.open_screen("download_manager", subtitles=subtitles) - self.manually_accepted_subtitles.extend(download_manager.DownloadManager.downloaded_subtitle) + self.manually_accepted_subtitles = download_manager.DownloadManager.downloaded_subtitle log.task_completed() @decorators.call_func @@ -193,12 +193,13 @@ def summary_notification(self, elapsed) -> None: log.brackets("Summary toast") elapsed_summary = f"Finished in {elapsed} seconds" tot_num_of_subtitles = len(self.accepted_subtitles) + len(self.rejected_subtitles) - matches_downloaded = f"Downloaded: {self.downloaded_subtitles}/{tot_num_of_subtitles}" - if self.downloaded_subtitles > 0: + all_downloaded = self.downloaded_subtitles + len(self.manually_accepted_subtitles) + matches_downloaded = f"Downloaded: {all_downloaded}/{tot_num_of_subtitles}" + if all_downloaded > 0: msg = "Search Succeeded", f"{matches_downloaded}\n{elapsed_summary}" log.stdout(matches_downloaded, hex_color="#a6e3a1") self.system_tray.display_toast(*msg) - elif self.downloaded_subtitles == 0: + elif all_downloaded == 0: msg = "Search Failed", f"{matches_downloaded}\n{elapsed_summary}" log.stdout(matches_downloaded, hex_color="#f38ba8") self.system_tray.display_toast(*msg)