fix notification bug on startup for already finished torrents
This commit is contained in:
parent
81b895bd1d
commit
6eb413dd1e
@ -42,18 +42,18 @@ class Notification:
|
|||||||
self.get_torrent_status(torrent_id)
|
self.get_torrent_status(torrent_id)
|
||||||
|
|
||||||
def get_torrent_status(self, torrent_id):
|
def get_torrent_status(self, torrent_id):
|
||||||
client.get_torrent_status(
|
client.get_torrent_status(self._on_get_torrent_status, torrent_id, ["name", "num_files"])
|
||||||
self._on_get_torrent_status, torrent_id, ["name", "num_files"])
|
|
||||||
|
|
||||||
def _on_get_torrent_status(self, status):
|
def _on_get_torrent_status(self, status):
|
||||||
if status is None:
|
if status is None:
|
||||||
return
|
return
|
||||||
if self.config["ntf_popup"]:
|
if status["total_payload_download"]:
|
||||||
self.popup(status)
|
if self.config["ntf_popup"]:
|
||||||
if self.config["ntf_email"]:
|
self.popup(status)
|
||||||
self.email(status)
|
if self.config["ntf_email"]:
|
||||||
if self.config["ntf_sound"]:
|
self.email(status)
|
||||||
self.sound()
|
if self.config["ntf_sound"]:
|
||||||
|
self.sound()
|
||||||
|
|
||||||
def popup(self, status):
|
def popup(self, status):
|
||||||
"""popups up notification of finished torrent"""
|
"""popups up notification of finished torrent"""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user