mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-04 15:38:43 +00:00
Move AutoAdd to core.
This commit is contained in:
parent
34ca508410
commit
2a9993cfe8
2 changed files with 6 additions and 6 deletions
|
@ -52,6 +52,7 @@ from deluge.core.torrentmanager import TorrentManager
|
||||||
from deluge.core.pluginmanager import PluginManager
|
from deluge.core.pluginmanager import PluginManager
|
||||||
from deluge.core.alertmanager import AlertManager
|
from deluge.core.alertmanager import AlertManager
|
||||||
from deluge.core.signalmanager import SignalManager
|
from deluge.core.signalmanager import SignalManager
|
||||||
|
from deluge.core.autoadd import AutoAdd
|
||||||
from deluge.log import LOG as log
|
from deluge.log import LOG as log
|
||||||
|
|
||||||
DEFAULT_PREFS = {
|
DEFAULT_PREFS = {
|
||||||
|
@ -244,6 +245,9 @@ class Core(
|
||||||
# Start the TorrentManager
|
# Start the TorrentManager
|
||||||
self.torrents = TorrentManager(self.session, self.alerts)
|
self.torrents = TorrentManager(self.session, self.alerts)
|
||||||
|
|
||||||
|
# Create the AutoAdd component
|
||||||
|
self.autoadd = AutoAdd()
|
||||||
|
|
||||||
component.start()
|
component.start()
|
||||||
|
|
||||||
t = threading.Thread(target=self.serve_forever)
|
t = threading.Thread(target=self.serve_forever)
|
||||||
|
|
|
@ -46,7 +46,7 @@ import deluge.component as component
|
||||||
from deluge.core.torrentqueue import TorrentQueue
|
from deluge.core.torrentqueue import TorrentQueue
|
||||||
from deluge.configmanager import ConfigManager
|
from deluge.configmanager import ConfigManager
|
||||||
from deluge.core.torrent import Torrent
|
from deluge.core.torrent import Torrent
|
||||||
from deluge.core.autoadd import AutoAdd
|
|
||||||
from deluge.log import LOG as log
|
from deluge.log import LOG as log
|
||||||
|
|
||||||
class TorrentState:
|
class TorrentState:
|
||||||
|
@ -140,9 +140,6 @@ class TorrentManager(component.Component):
|
||||||
self.on_alert_storage_moved)
|
self.on_alert_storage_moved)
|
||||||
self.alerts.register_handler("file_error_alert", self.on_alert_file_error)
|
self.alerts.register_handler("file_error_alert", self.on_alert_file_error)
|
||||||
|
|
||||||
# Create the AutoAdd component
|
|
||||||
self.autoadd = AutoAdd()
|
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
# Get the pluginmanager reference
|
# Get the pluginmanager reference
|
||||||
self.plugins = component.get("PluginManager")
|
self.plugins = component.get("PluginManager")
|
||||||
|
@ -633,7 +630,6 @@ class TorrentManager(component.Component):
|
||||||
# Get the torrent_id
|
# Get the torrent_id
|
||||||
torrent_id = str(alert.handle.info_hash())
|
torrent_id = str(alert.handle.info_hash())
|
||||||
# Set the torrent state
|
# Set the torrent state
|
||||||
log.debug("self.torrents: %s", self.torrents)
|
|
||||||
if not self.torrents[torrent_id].handle.is_paused():
|
if not self.torrents[torrent_id].handle.is_paused():
|
||||||
if self.torrents[torrent_id].handle.is_seed():
|
if self.torrents[torrent_id].handle.is_seed():
|
||||||
self.torrents[torrent_id].set_state("Seeding")
|
self.torrents[torrent_id].set_state("Seeding")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue