mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-09 09:58:39 +00:00
Scrape tracker if we do not receive any peer information on announce.
Minor UI tweaks.
This commit is contained in:
parent
a7e6ec4b06
commit
aa019231ba
3 changed files with 655 additions and 642 deletions
|
@ -366,7 +366,17 @@ class TorrentManager:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def scrape_tracker(self, torrent_id):
|
||||||
|
"""Scrape the tracker"""
|
||||||
|
try:
|
||||||
|
self.torrents[torrent_id].handle.scrape_tracker()
|
||||||
|
except Exception, e:
|
||||||
|
log.debug("Unable to scrape tracker: %s", e)
|
||||||
|
return False
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
def force_recheck(self, torrent_id):
|
def force_recheck(self, torrent_id):
|
||||||
"""Forces a re-check of the torrent's data"""
|
"""Forces a re-check of the torrent's data"""
|
||||||
log.debug("Doing a forced recheck on %s", torrent_id)
|
log.debug("Doing a forced recheck on %s", torrent_id)
|
||||||
|
@ -514,7 +524,7 @@ class TorrentManager:
|
||||||
torrent_id = str(alert.handle.info_hash())
|
torrent_id = str(alert.handle.info_hash())
|
||||||
# Write the fastresume file
|
# Write the fastresume file
|
||||||
self.write_fastresume(torrent_id)
|
self.write_fastresume(torrent_id)
|
||||||
|
|
||||||
def on_alert_tracker_reply(self, alert):
|
def on_alert_tracker_reply(self, alert):
|
||||||
log.debug("on_alert_tracker_reply")
|
log.debug("on_alert_tracker_reply")
|
||||||
# Get the torrent_id
|
# Get the torrent_id
|
||||||
|
@ -524,6 +534,12 @@ class TorrentManager:
|
||||||
self.torrents[torrent_id].set_tracker_status(_("Announce OK"))
|
self.torrents[torrent_id].set_tracker_status(_("Announce OK"))
|
||||||
except KeyError:
|
except KeyError:
|
||||||
log.debug("torrent_id doesn't exist.")
|
log.debug("torrent_id doesn't exist.")
|
||||||
|
|
||||||
|
# Check to see if we got any peer information from the tracker
|
||||||
|
if alert.handle.status().num_complete == -1 or \
|
||||||
|
alert.handle.status().num_incomplete == -1:
|
||||||
|
# We didn't get peer information, so lets send a scrape request
|
||||||
|
self.scrape_tracker(torrent_id)
|
||||||
|
|
||||||
def on_alert_tracker_announce(self, alert):
|
def on_alert_tracker_announce(self, alert):
|
||||||
log.debug("on_alert_tracker_announce")
|
log.debug("on_alert_tracker_announce")
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -57,6 +57,9 @@ class SideBar(component.Component):
|
||||||
self.liststore.append([_("Seeding"),
|
self.liststore.append([_("Seeding"),
|
||||||
gtk.gdk.pixbuf_new_from_file(
|
gtk.gdk.pixbuf_new_from_file(
|
||||||
deluge.common.get_pixmap("seeding16.png"))])
|
deluge.common.get_pixmap("seeding16.png"))])
|
||||||
|
self.liststore.append([_("Paused"),
|
||||||
|
gtk.gdk.pixbuf_new_from_file(
|
||||||
|
deluge.common.get_pixmap("inactive16.png"))])
|
||||||
# Create the column
|
# Create the column
|
||||||
column = gtk.TreeViewColumn(_("Labels"))
|
column = gtk.TreeViewColumn(_("Labels"))
|
||||||
column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
|
column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue