mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-13 13:05:37 +00:00
[Core] Add TorrentTrackerStatusEvent
This commit is contained in:
parent
431357f623
commit
ca1eaa5e15
@ -29,7 +29,7 @@ from deluge._libtorrent import lt
|
|||||||
from deluge.common import decode_string, utf8_encoded
|
from deluge.common import decode_string, utf8_encoded
|
||||||
from deluge.configmanager import ConfigManager, get_config_dir
|
from deluge.configmanager import ConfigManager, get_config_dir
|
||||||
from deluge.core.authmanager import AUTH_LEVEL_ADMIN
|
from deluge.core.authmanager import AUTH_LEVEL_ADMIN
|
||||||
from deluge.event import TorrentFolderRenamedEvent, TorrentStateChangedEvent
|
from deluge.event import TorrentFolderRenamedEvent, TorrentStateChangedEvent, TorrentTrackerStatusEvent
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -602,10 +602,16 @@ class Torrent(object):
|
|||||||
Args:
|
Args:
|
||||||
status (str): The tracker status.
|
status (str): The tracker status.
|
||||||
|
|
||||||
|
Emits:
|
||||||
|
TorrentTrackerStatusEvent upon tracker status change.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
self.tracker_host = None
|
self.tracker_host = None
|
||||||
|
|
||||||
|
if self.tracker_status != status:
|
||||||
self.tracker_status = status
|
self.tracker_status = status
|
||||||
|
component.get("EventManager").emit(TorrentTrackerStatusEvent(self.torrent_id, self.tracker_status))
|
||||||
|
|
||||||
def merge_trackers(self, torrent_info):
|
def merge_trackers(self, torrent_info):
|
||||||
"""Merges new trackers in torrent_info into torrent"""
|
"""Merges new trackers in torrent_info into torrent"""
|
||||||
|
@ -104,6 +104,19 @@ class TorrentStateChangedEvent(DelugeEvent):
|
|||||||
self._args = [torrent_id, state]
|
self._args = [torrent_id, state]
|
||||||
|
|
||||||
|
|
||||||
|
class TorrentTrackerStatusEvent(DelugeEvent):
|
||||||
|
"""
|
||||||
|
Emitted when a torrents tracker status changes.
|
||||||
|
"""
|
||||||
|
def __init__(self, torrent_id, status):
|
||||||
|
"""
|
||||||
|
Args:
|
||||||
|
torrent_id (str): the torrent_id
|
||||||
|
status (str): the new status
|
||||||
|
"""
|
||||||
|
self._args = [torrent_id, status]
|
||||||
|
|
||||||
|
|
||||||
class TorrentQueueChangedEvent(DelugeEvent):
|
class TorrentQueueChangedEvent(DelugeEvent):
|
||||||
"""
|
"""
|
||||||
Emitted when the queue order has changed.
|
Emitted when the queue order has changed.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user