Scrape tracker if we do not receive any peer information on announce.

Minor UI tweaks.
This commit is contained in:
Andrew Resch 2007-11-29 07:09:18 +00:00
parent a7e6ec4b06
commit aa019231ba
3 changed files with 655 additions and 642 deletions

View File

@ -367,6 +367,16 @@ class TorrentManager:
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)
@ -525,6 +535,12 @@ class TorrentManager:
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")
# Get the torrent_id # Get the torrent_id

File diff suppressed because it is too large Load Diff

View File

@ -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)