summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRFBomb <Robbery525@gmail.com>2020-05-05 19:15:47 -0400
committerCalum Lind <calumlind+deluge@gmail.com>2021-04-17 17:24:58 +0100
commit2e466101fc20aa4314049d942d56e2be75fd70ae (patch)
tree777649cb8e49b0478c314a6cc66efe980bd597d0
parent8676a0d2a0cc0fc36f2c366194f188ea947f4b1f (diff)
downloaddeluge-2e466101fc20aa4314049d942d56e2be75fd70ae.zip
deluge-2e466101fc20aa4314049d942d56e2be75fd70ae.tar.gz
deluge-2e466101fc20aa4314049d942d56e2be75fd70ae.tar.bz2
[AutoAdd] Fix magnet missing applied labels
The autoadd function does not apply labels to torrents that are added via magnet files. Those magnet files are also renamed ".Magnet.Invalid". Here are two threads discussing the issue, which still exists. https://forum.deluge-torrent.org/viewtopic.php?t=55539 https://dev.deluge-torrent.org/ticket/3295 Here is what Deluged.log shows when the problem occurs: 21:51:38 [ERROR ][deluge_autoadd.core :333 ] Cannot Autoadd magnet: /Torrents/TorrentFiles/FileName.magnet: Torrent already in session (e1e0f33b656cb74532dcddc04f2ec52771ef1c26). 21:56:38 [ERROR ][deluge_autoadd.core :333 ] Cannot Autoadd magnet: /Torrents/TorrentFiles/FileName2.magnet: Torrent already in session (ef839d84d113cc35719b6fd616a4d8e220de7d32). After looking at the code, what appears to be happening is the magnet link is added, but then a second scan of the folder occurs. Since the magnet file was never renamed, it will attempt to add it again, error out, then rename the file "magnet.invalid". The only difference between the torrents working properly and magnets having the issue is the two lines I copy-pasted into the magnet IF statement. This should resolve the issue.
-rw-r--r--deluge/plugins/AutoAdd/deluge_autoadd/core.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/deluge/plugins/AutoAdd/deluge_autoadd/core.py b/deluge/plugins/AutoAdd/deluge_autoadd/core.py
index 79e5327..668f461 100644
--- a/deluge/plugins/AutoAdd/deluge_autoadd/core.py
+++ b/deluge/plugins/AutoAdd/deluge_autoadd/core.py
@@ -344,8 +344,8 @@ class Core(CorePluginBase):
d = component.get('Core').add_torrent_file_async(
filename, b64encode(filedump), options
)
- d.addCallback(on_torrent_added, filename, filepath)
- d.addErrback(fail_torrent_add, filepath, magnet)
+ d.addCallback(on_torrent_added, filename, filepath)
+ d.addErrback(fail_torrent_add, filepath, magnet)
except AddTorrentError as ex:
fail_torrent_add(str(ex), filepath, magnet)