mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
Fixed a minor problem with events on torrent addition
This commit is contained in:
parent
1da24fbeaa
commit
ac79938c20
1 changed files with 3 additions and 3 deletions
|
@ -71,13 +71,13 @@ class EventLog(component.Component):
|
||||||
def on_torrent_added_event(self, torrent_id, from_state):
|
def on_torrent_added_event(self, torrent_id, from_state):
|
||||||
if from_state: return
|
if from_state: return
|
||||||
def on_torrent_status(status):
|
def on_torrent_status(status):
|
||||||
self.write("{!green!}Torrent Added{!input!}(from_state=%s): {!info!}%s (%s)" % (
|
self.write("{!green!}Torrent Added: {!info!}%s (%s)" % (
|
||||||
from_state, status["name"], torrent_id)
|
status["name"], torrent_id)
|
||||||
)
|
)
|
||||||
#Write out what state the added torrent took
|
#Write out what state the added torrent took
|
||||||
self.on_torrent_state_changed_event(torrent_id, status["state"])
|
self.on_torrent_state_changed_event(torrent_id, status["state"])
|
||||||
|
|
||||||
client.core.get_torrent_status(torrent_id, ["name"]).addCallback(on_torrent_status)
|
client.core.get_torrent_status(torrent_id, ["name", "state"]).addCallback(on_torrent_status)
|
||||||
|
|
||||||
def on_torrent_removed_event(self, torrent_id):
|
def on_torrent_removed_event(self, torrent_id):
|
||||||
self.write("{!red!}Torrent Removed: {!info!}%s (%s)" %
|
self.write("{!red!}Torrent Removed: {!info!}%s (%s)" %
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue