mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-13 13:05:37 +00:00
Move AutoAdd to core.
This commit is contained in:
parent
34ca508410
commit
2a9993cfe8
@ -52,6 +52,7 @@ from deluge.core.torrentmanager import TorrentManager
|
||||
from deluge.core.pluginmanager import PluginManager
|
||||
from deluge.core.alertmanager import AlertManager
|
||||
from deluge.core.signalmanager import SignalManager
|
||||
from deluge.core.autoadd import AutoAdd
|
||||
from deluge.log import LOG as log
|
||||
|
||||
DEFAULT_PREFS = {
|
||||
@ -244,6 +245,9 @@ class Core(
|
||||
# Start the TorrentManager
|
||||
self.torrents = TorrentManager(self.session, self.alerts)
|
||||
|
||||
# Create the AutoAdd component
|
||||
self.autoadd = AutoAdd()
|
||||
|
||||
component.start()
|
||||
|
||||
t = threading.Thread(target=self.serve_forever)
|
||||
|
@ -46,7 +46,7 @@ import deluge.component as component
|
||||
from deluge.core.torrentqueue import TorrentQueue
|
||||
from deluge.configmanager import ConfigManager
|
||||
from deluge.core.torrent import Torrent
|
||||
from deluge.core.autoadd import AutoAdd
|
||||
|
||||
from deluge.log import LOG as log
|
||||
|
||||
class TorrentState:
|
||||
@ -140,15 +140,12 @@ class TorrentManager(component.Component):
|
||||
self.on_alert_storage_moved)
|
||||
self.alerts.register_handler("file_error_alert", self.on_alert_file_error)
|
||||
|
||||
# Create the AutoAdd component
|
||||
self.autoadd = AutoAdd()
|
||||
|
||||
def start(self):
|
||||
# Get the pluginmanager reference
|
||||
self.plugins = component.get("PluginManager")
|
||||
|
||||
self.signals = component.get("SignalManager")
|
||||
|
||||
|
||||
# Try to load the state from file
|
||||
self.load_state()
|
||||
|
||||
@ -633,7 +630,6 @@ class TorrentManager(component.Component):
|
||||
# Get the torrent_id
|
||||
torrent_id = str(alert.handle.info_hash())
|
||||
# Set the torrent state
|
||||
log.debug("self.torrents: %s", self.torrents)
|
||||
if not self.torrents[torrent_id].handle.is_paused():
|
||||
if self.torrents[torrent_id].handle.is_seed():
|
||||
self.torrents[torrent_id].set_state("Seeding")
|
||||
|
Loading…
x
Reference in New Issue
Block a user