Skip to content

Commit

Permalink
Fix downloaded message in summary toast
Browse files Browse the repository at this point in the history
  • Loading branch information
vagabondHustler committed Jul 21, 2024
1 parent 22e0933 commit 21599d0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/subsearch/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 21599d0

Please sign in to comment.