Page 1 of 1

[Plugin] Fixed deluge2-included AutoAdd plugin

Posted: Wed Jun 23, 2021 7:10 pm
by mhertz
As title, untill Cas fixes it, then this is a fixed version of the included AutoAdd plugin of deluge2, which recently broke magnet support in 2.0.4.dev56, used e.g. on arch-linux and binhex dockers etc, but had issues also before(e.g deluge 2.0.3) where labels not applied for magnets and .magnet files renamed .invalid.

I previously posted a version in other thread, which just unbroke magnet support of dev56 but left the other issues unfixed, but this here is full fix for all deluge2 versions, so no .magnet files labeled .invalid anymore for no reason, is correctly deleted/renamed after adding, and labels work again for them.

The issue btw was that add_torrent_magnet() isn't returning a defered object like add_torrent_file_async(), so the scheduled deferred of magnets never ran and error'ed out with attribute-error(as the returned torrent_id string didn't have no addCallback attribute i.e. not a deferred), and disables watchdir. Pre-dev56, then on_torrent_added() never called for magnets, and so at next poll-interval would try readd, fail and hence rename .invalid. Anyway, so I changed the call for magnets from a twisted addCallback into instead direct function call, and added the addCallback/addErrback only for torrents and not magnets, making magnets and labels work again. I reported this to Cas on bugtracker also.

Just drop into your deluge profile's plugins folder, restart deluge, and it will take precedense over the included version. I also upped version from 1.8 to 1.9 and changed entry-points needed for taking precedence also on dockers.

AutoAdd-1.9.egg

Edit: Rebuilt using Cas' official fix from develop branch, and so only need my rebuild if using under 2.0.4.dev57.

Re: [Plugin] Fixed deluge2-included AutoAdd plugin

Posted: Sun Jul 11, 2021 10:16 pm
by DarkSlave
Thank you for this; my AutoAdd had been broken for some time now, and I was having to manually enable/disable for it to catch.
Works as it used to, thanks!

Re: [Plugin] Fixed deluge2-included AutoAdd plugin

Posted: Mon Jul 12, 2021 9:51 am
by mhertz
I'm glad to hear that and you're very much welcome mate :) Thanks likewise for reporting back, and your post :)

Re: [Plugin] Fixed deluge2-included AutoAdd plugin

Posted: Sat Jul 24, 2021 12:18 pm
by mhertz
Cas just fixed this officially in develop branch, more professionally than my solution, obviously, but anyway, just wanted to add that my fixed build here then only needed for under 2.0.4.dev57.

https://github.com/deluge-torrent/delug ... 3611c3081d

When I'm back at my computer later today, we'll maybe first tomorrow if I'm extra lazy, but anyway I'll rebuild the plugin from source so has Cas's actual fix and not mine, might as well, and make the usual changes for having it override default plugin and also on dockers which otherwise are problematic in this regard needing extra measures - I'll make an edit to this post and top-post when finished.

Thanks Cas! :)

Edit: Done - first post link and notice updated accordingly.