mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-09 09:58:39 +00:00
update tracker aka force reannounce
This commit is contained in:
parent
d91bcbe55c
commit
731c51815e
4 changed files with 24 additions and 0 deletions
|
@ -212,6 +212,12 @@ class Core(dbus.service.Object):
|
||||||
# Emit the torrent_removed signal
|
# Emit the torrent_removed signal
|
||||||
self.torrent_removed(torrent_id)
|
self.torrent_removed(torrent_id)
|
||||||
|
|
||||||
|
@dbus.service.method(dbus_interface="org.deluge_torrent.Deluge",
|
||||||
|
in_signature="s", out_signature="")
|
||||||
|
def force_reannounce(self, torrent_id):
|
||||||
|
log.debug("Forcing reannouncment to trackers of torrent %s", torrent_id)
|
||||||
|
self.torrents.force_reannounce(torrent_id)
|
||||||
|
|
||||||
@dbus.service.method(dbus_interface="org.deluge_torrent.Deluge",
|
@dbus.service.method(dbus_interface="org.deluge_torrent.Deluge",
|
||||||
in_signature="s", out_signature="")
|
in_signature="s", out_signature="")
|
||||||
def pause_torrent(self, torrent_id):
|
def pause_torrent(self, torrent_id):
|
||||||
|
|
|
@ -197,6 +197,16 @@ class TorrentManager:
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def force_reannounce(self, torrent_id):
|
||||||
|
"""Resume a torrent"""
|
||||||
|
try:
|
||||||
|
self.torrents[torrent_id].handle.force_reannounce()
|
||||||
|
except:
|
||||||
|
return False
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
def load_state(self):
|
def load_state(self):
|
||||||
"""Load the state of the TorrentManager from the torrents.state file"""
|
"""Load the state of the TorrentManager from the torrents.state file"""
|
||||||
state = TorrentManagerState()
|
state = TorrentManagerState()
|
||||||
|
|
|
@ -122,6 +122,12 @@ def resume_torrent(torrent_ids):
|
||||||
for torrent_id in torrent_ids:
|
for torrent_id in torrent_ids:
|
||||||
core.resume_torrent(torrent_id)
|
core.resume_torrent(torrent_id)
|
||||||
|
|
||||||
|
def force_reannounce(torrent_ids):
|
||||||
|
"""Reannounce to trackers"""
|
||||||
|
core = get_core()
|
||||||
|
for torrent_id in torrent_ids:
|
||||||
|
core.force_reannounce(torrent_id)
|
||||||
|
|
||||||
def get_torrent_status(core, torrent_id, keys):
|
def get_torrent_status(core, torrent_id, keys):
|
||||||
"""Builds the status dictionary and returns it"""
|
"""Builds the status dictionary and returns it"""
|
||||||
status = core.get_torrent_status(torrent_id, keys)
|
status = core.get_torrent_status(torrent_id, keys)
|
||||||
|
|
|
@ -137,6 +137,8 @@ class MenuBar:
|
||||||
|
|
||||||
def on_menuitem_updatetracker_activate(self, data=None):
|
def on_menuitem_updatetracker_activate(self, data=None):
|
||||||
log.debug("on_menuitem_updatetracker_activate")
|
log.debug("on_menuitem_updatetracker_activate")
|
||||||
|
functions.force_reannounce(
|
||||||
|
self.window.torrentview.get_selected_torrents())
|
||||||
|
|
||||||
def on_menuitem_edittrackers_activate(self, data=None):
|
def on_menuitem_edittrackers_activate(self, data=None):
|
||||||
log.debug("on_menuitem_edittrackers_activate")
|
log.debug("on_menuitem_edittrackers_activate")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue