mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-03 06:58:42 +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
|
@ -367,6 +367,16 @@ class TorrentManager:
|
|||
|
||||
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):
|
||||
"""Forces a re-check of the torrent's data"""
|
||||
log.debug("Doing a forced recheck on %s", torrent_id)
|
||||
|
@ -525,6 +535,12 @@ class TorrentManager:
|
|||
except KeyError:
|
||||
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):
|
||||
log.debug("on_alert_tracker_announce")
|
||||
# Get the torrent_id
|
||||
|
|
|
@ -408,6 +408,7 @@
|
|||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<child>
|
||||
<widget class="GtkScrolledWindow" id="scrolledwindow_sidebar">
|
||||
<property name="width_request">110</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
|
@ -459,11 +460,6 @@
|
|||
<property name="shrink">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkViewport" id="viewport1">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="resize_mode">GTK_RESIZE_QUEUE</property>
|
||||
<child>
|
||||
<widget class="GtkNotebook" id="torrent_info">
|
||||
<property name="visible">True</property>
|
||||
|
@ -1165,8 +1161,6 @@
|
|||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="resize">False</property>
|
||||
<property name="shrink">False</property>
|
||||
|
|
|
@ -57,6 +57,9 @@ class SideBar(component.Component):
|
|||
self.liststore.append([_("Seeding"),
|
||||
gtk.gdk.pixbuf_new_from_file(
|
||||
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
|
||||
column = gtk.TreeViewColumn(_("Labels"))
|
||||
column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue