mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
fix auto-add
This commit is contained in:
parent
b20add89e4
commit
e1a7adeae5
1 changed files with 5 additions and 4 deletions
|
@ -328,10 +328,11 @@ class Core(CorePluginBase):
|
||||||
|
|
||||||
def _has_auto_match(self, torrent ,label_options):
|
def _has_auto_match(self, torrent ,label_options):
|
||||||
"match for auto_add fields"
|
"match for auto_add fields"
|
||||||
|
log.debug(111)
|
||||||
for tracker_match in label_options["auto_add_trackers"]:
|
for tracker_match in label_options["auto_add_trackers"]:
|
||||||
|
log.debug(torrent.trackers)
|
||||||
for tracker in torrent.trackers:
|
for tracker in torrent.trackers:
|
||||||
log.debug(tracker_match in tracker["url"])
|
log.debug((tracker_match , tracker["url"],tracker_match in tracker["url"]))
|
||||||
log.debug((tracker_match , tracker["url"]))
|
|
||||||
if tracker_match in tracker["url"]:
|
if tracker_match in tracker["url"]:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
@ -367,7 +368,7 @@ class Core(CorePluginBase):
|
||||||
#auto add
|
#auto add
|
||||||
options = self.labels[label_id]
|
options = self.labels[label_id]
|
||||||
if options["auto_add"]:
|
if options["auto_add"]:
|
||||||
for torrent in self.torrents.values():
|
for torrent_id, torrent in self.torrents.iteritems():
|
||||||
if self._has_auto_match(torrent, options):
|
if self._has_auto_match(torrent, options):
|
||||||
self.export_set_torrent(torrent_id , label_id)
|
self.export_set_torrent(torrent_id , label_id)
|
||||||
|
|
||||||
|
@ -394,7 +395,7 @@ class Core(CorePluginBase):
|
||||||
self.clean_config()
|
self.clean_config()
|
||||||
else:
|
else:
|
||||||
self.torrent_labels[torrent_id] = label_id
|
self.torrent_labels[torrent_id] = label_id
|
||||||
self.set_torrent_options(torrent_id, label_id)
|
self._set_torrent_options(torrent_id, label_id)
|
||||||
|
|
||||||
self.config.save()
|
self.config.save()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue