Skip to content

Commit

Permalink
Check torrents on click in GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
ichorid committed Feb 28, 2020
1 parent 7008530 commit 2070503
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(self, parent):

self.healthcheck_timer = QTimer()
self.healthcheck_timer.setSingleShot(True)
self.healthcheck_timer.timeout.connect(self.check_torrent_health)
self.healthcheck_timer.timeout.connect(self.on_check_health_clicked)
self.currentChanged.connect(self.on_tab_changed)

self.rest_request1 = None
Expand Down Expand Up @@ -120,6 +120,8 @@ def update_with_torrent(self, index, torrent_info):
self.rest_request2.cancel_request()
self.is_health_checking = False
if torrent_info['last_tracker_check'] == 0:
if not self.healthcheck_timer.isActive():
self.on_check_health_clicked()
self.healthcheck_timer.stop()
self.healthcheck_timer.start(HEALTHCHECK_DELAY)
self.update_health_label(
Expand Down Expand Up @@ -152,6 +154,8 @@ def check_torrent_health(self):
return
infohash = self.torrent_info[u'infohash']

self.is_health_checking = True

def on_cancel_health_check():
self.is_health_checking = False

Expand Down

0 comments on commit 2070503

Please sign in to comment.