mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-21 12:04:51 +00:00
fix notification bug on startup for already finished torrents
This commit is contained in:
parent
89800dd6c1
commit
cf40455d1c
1 changed files with 8 additions and 8 deletions
|
@ -42,18 +42,18 @@ class Notification:
|
|||
self.get_torrent_status(torrent_id)
|
||||
|
||||
def get_torrent_status(self, torrent_id):
|
||||
client.get_torrent_status(
|
||||
self._on_get_torrent_status, torrent_id, ["name", "num_files"])
|
||||
client.get_torrent_status(self._on_get_torrent_status, torrent_id, ["name", "num_files", "total_payload_download"])
|
||||
|
||||
def _on_get_torrent_status(self, status):
|
||||
if status is None:
|
||||
return
|
||||
if self.config["ntf_popup"]:
|
||||
self.popup(status)
|
||||
if self.config["ntf_email"]:
|
||||
self.email(status)
|
||||
if self.config["ntf_sound"]:
|
||||
self.sound()
|
||||
if status["total_payload_download"]:
|
||||
if self.config["ntf_popup"]:
|
||||
self.popup(status)
|
||||
if self.config["ntf_email"]:
|
||||
self.email(status)
|
||||
if self.config["ntf_sound"]:
|
||||
self.sound()
|
||||
|
||||
def popup(self, status):
|
||||
"""popups up notification of finished torrent"""
|
||||
|
|
Loading…
Add table
Reference in a new issue