mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 11:35:49 +00:00
autoadd plugin will now transfer settings from core autoadd folder
This commit is contained in:
parent
8fb56f0410
commit
017d1e058e
1 changed files with 11 additions and 6 deletions
|
@ -101,6 +101,17 @@ class Core(CorePluginBase):
|
|||
self.attempts = {}
|
||||
# Loopingcall timers for each enabled watchdir
|
||||
self.update_timers = {}
|
||||
# If core autoadd folder is enabled, move it to the plugin
|
||||
if self.core_cfg.config.get('autoadd_enable'):
|
||||
# Disable core autoadd
|
||||
self.core_cfg['autoadd_enable'] = False
|
||||
# Check if core autoadd folder is already added in plugin
|
||||
for watchdir in self.watchdirs:
|
||||
if os.path.abspath(self.core_cfg['autoadd_location']) == watchdir['abspath']:
|
||||
break
|
||||
else:
|
||||
# didn't find core watchdir, add it
|
||||
self.add({'path':self.core_cfg['autoadd_location'], 'enabled':True})
|
||||
deferLater(reactor, 5, self.enable_looping)
|
||||
|
||||
def enable_looping(self):
|
||||
|
@ -232,12 +243,6 @@ class Core(CorePluginBase):
|
|||
def enable_watchdir(self, watchdir_id):
|
||||
watchdir_id = str(watchdir_id)
|
||||
self.watchdirs[watchdir_id]['enabled'] = True
|
||||
#If deluge core autoadd is enabled for this path, disable it
|
||||
#log.error(self.core_cfg['autoadd_enable'])
|
||||
if self.core_cfg.config.get('autoadd_enable'):
|
||||
log.error("glob: %s loc: %s" % (os.path.abspath(self.core_cfg['autoadd_location']), self.watchdirs[watchdir_id]['abspath']))
|
||||
if os.path.abspath(self.core_cfg['autoadd_location']) == self.watchdirs[watchdir_id]['abspath']:
|
||||
self.core_cfg['autoadd_enable'] = False
|
||||
#Enable the looping call
|
||||
self.update_timers[watchdir_id] = LoopingCall(self.update_watchdir, watchdir_id)
|
||||
self.update_timers[watchdir_id].start(5)
|
||||
|
|
Loading…
Add table
Reference in a new issue