[Plugin] Fixed deluge2-included AutoAdd plugin

Suggest, post, or discuss plugins for Deluge
Post Reply
mhertz
Moderator
Moderator
Posts: 2182
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

[Plugin] Fixed deluge2-included AutoAdd plugin

Post 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.
DarkSlave
New User
New User
Posts: 4
Joined: Thu May 17, 2018 4:23 pm

Re: [Plugin] Fixed deluge2-included AutoAdd plugin

Post 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!
mhertz
Moderator
Moderator
Posts: 2182
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: [Plugin] Fixed deluge2-included AutoAdd plugin

Post by mhertz »

I'm glad to hear that and you're very much welcome mate :) Thanks likewise for reporting back, and your post :)
mhertz
Moderator
Moderator
Posts: 2182
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: [Plugin] Fixed deluge2-included AutoAdd plugin

Post 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.
Post Reply