[Plugin] Auto Remove Plus v0.6.1

Suggest, post, or discuss plugins for Deluge
Auguss
New User
New User
Posts: 5
Joined: Mon Sep 23, 2013 11:26 pm

Re: [Plugin] Auto Remove Plus v0.6.1

Post by Auguss »

Because it was written in decimal instead of minutes. Who needs that fine grained setting of calculation?
Bobby
Member
Member
Posts: 43
Joined: Wed Aug 05, 2020 7:37 pm

Re: [Plugin] Auto Remove Plus v0.6.1

Post by Bobby »

Does anyone know if this plugin is working with labelplus ? :-) I am using deluge 1.3.15
logue1021
New User
New User
Posts: 1
Joined: Sun Jan 10, 2021 12:23 pm

Re: [Plugin] Auto Remove Plus v0.6.1

Post by logue1021 »

My install:

Code: Select all

deluged 2.0.3
libtorrent: 1.1.13.0
Python: 3.8.5
OS: Linux Ubuntu 20.04 focal
I've got AutoRemovePlus-0.6.15-py3.8.egg-tmp installed into my /var/lib/deluge/.cache/Python-Eggs/ path

I can't seem to understand the "Remove by Ratio"? I have it set at 2.5, but I have torrents that are vastly above, some 10+:
Image

What I'm trying to do: Have torrents removed after 7 days, OR if they've reached a 2.5 seed ratio. The after 7 days appears to be working, but the seed ratio doesn't.

Log for one of the 10+:

Code: Select all

16:43:08 [DEBUG   ][autoremoveplus.core           :586 ] Now processing name = The.Expanse.S05E07.Oyedeng.1080p.AMZN.WEBRip.DDP5.1.x264-NTG[rarbg], type = <class 'str'>
16:43:08 [DEBUG   ][autoremoveplus.core           :367 ] Space: 2730.409523010254/-1.0
16:43:08 [DEBUG   ][autoremoveplus.core           :90  ] Get ratio: i = b1e28fe5f17065c15d79cbb16c42af37db241c6f, t = <deluge.core.torrent.Torrent object at 0x7f921d0afa90>
16:43:08 [DEBUG   ][autoremoveplus.core           :108 ] Now = 1610836988.4449334, added = 1610500503
16:43:08 [DEBUG   ][autoremoveplus.core           :110 ] Returning age: 3.89
16:43:08 [DEBUG   ][autoremoveplus.core           :433 ] Get_torrent_rules: returning rules for b1e28fe5f17065c15d79cbb16c42af37db241c6f: []
16:43:08 [DEBUG   ][autoremoveplus.core           :108 ] Now = 1610836988.445165, added = 1610500503
16:43:08 [DEBUG   ][autoremoveplus.core           :110 ] Returning age: 3.89
16:43:08 [DEBUG   ][autoremoveplus.core           :689 ] Fin.: The.Expanse.S05E07.Oyedeng.1080p.AMZN.WEBRip.DDP5.1.x264-NTG[rarbg], seed time:102.82/120.0, ratio: 13.598852092028194, spec. rules = [], sr cond. = False/False,isfinished = True, hash = B1E28FE5F17065C15D79CBB16C42AF37DB241C6F
Help please
mhertz
Compulsive Poster
Compulsive Poster
Posts: 1157
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: [Plugin] Auto Remove Plus v0.6.1

Post by mhertz »

I fixed an issue in springjools fork with some conditions not triggering in thinclient mode without GUI open, like I also did with tote94's fork which I posted in his thread also. The issue was that the TorrentManager get_status() deluge api-call returns cached libtorrent values, and need extra argument 'update=True', as else only updates the cached libtorrent values when GUI opened as uses that itself. I added the argument to dynamic field requests of that call, but not static ones like name and size etc.

AutoRemovePlus-0.6.15-py3.9.egg
Rename to match used python version, if needed.

Also, springjools fork applies conditions only for unfinished torrents, in contrary to tote94's fork(and original plugin), so I made extra alternative version which works only for finished torrents now, just for people preferring that, though then the two above rules for pause or remove seeds based on seedtime, which does work for finished torrents, now doesn't work in this version, as no reason to have two same options I guess. The seedtime option in the dropdown-conditions further down didn't have any effect before, without this mod here, I believe from looking at code. Note, this was very quick, and so there will probably be wrong logging about deleting unfinished torrent, when a finished torrent get removed etc, which I didn't bother to fix up, or other unforseen quirks.

AutoRemovePlus-0.6.15-py3.9.egg
Again, rename to match used python version, if needed.

I made these fixed versions of springjools fork even though I previously made the tote94 fixed version, because this version by springjools includes more fixes and features, though still misses GTKUI preferences dialog and needs be setup with webUI or editing config-file manually. Last, the log of GTKUI states error and failed enabling plugin, but that is not true, and only refers to the GTKUI preferences part of plugin, and not the core functionality, which does work. This isn't something I introduced and also in original fork without my changes.

I'll make a ticket later on the author's github project page to make note of the issue, so that official fix and release can be made.

Edit: Done: https://github.com/springjools/deluge-a ... /issues/36

Edit2: Jools replied he will add this set_status() fix :)
mhertz
Compulsive Poster
Compulsive Poster
Posts: 1157
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: [Plugin] Auto Remove Plus v0.6.1

Post by mhertz »

It's very far from perfect, but anyway, I regardless fixed the issues hindering the GTKUI preferences page showing of springjools fork, but as said, it need serious updating as missing bunch of stuff, but atleast now no startup errors in log/terminal upon every GTKUI startup and atleast some options exposed there, and atleast it's a starting point for springjools to hopefully further expand and work upon, and i'll shortly post a ticket at his github with a diff patch of needed changes. I fixed an issue in setup.py and then rest 31 fixes came from going over gtk3ui.py with a fine-tooth comb, analyzing error-output and comparing triggered lines to tote94's work, so all credit for most fixes to tote94, thank you!

Here's a few pics if interested in how looks and how many options exposed currently, and rest need webUI or manually edit config-file, untill updated further, hopefully, as said.

I will include links further down, for builds of mine with this fix in mean time, and optionally also the thinclient fix and finished-only mod, from last post, As always rename python version to match, if needed.

https://imgur.com/a/FLJnR1z (4 pics in one link - sorry for not just resizing transient window in hindsight, doh!)

AutoRemovePlus-0.6.15-py3.9.egg (GTKUI prefs fix)

AutoRemovePlus-0.6.15-py3.9.egg (GTKUI prefs fix + thinclient fix)

AutoRemovePlus-0.6.15-py3.9.egg (GTKUI prefs fix + thinclient fix + finsihed-only mod)

Edit: Github ticket for this: https://github.com/springjools/deluge-a ... /issues/37
Last edited by mhertz on Thu May 06, 2021 1:19 pm, edited 1 time in total.
mhertz
Compulsive Poster
Compulsive Poster
Posts: 1157
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: [Plugin] Auto Remove Plus v0.6.1

Post by mhertz »

Sorry, I guess didn't test good enough, as efter seeing the prefs page and no errors, I "hard-killed" the prefs-window and deluge for some reason, so didn't notice that you cannot press 'Apply' or 'Ok' anymore now, only 'Cancel', meaning you couldn't anymore make changes "stick" in deluge prefs menu, doh! Sorry about that. I fixed the additional issue, and rebuilt plugins from above and here's fixed versions, and again apologize for inconvenience and the oversight.

AutoRemovePlus-0.6.15-py3.9.egg (GTKUI prefs fix)

AutoRemovePlus-0.6.15-py3.9.egg (GTKUI prefs fix + thinclient fix)

AutoRemovePlus-0.6.15-py3.9.egg (GTKUI prefs fix + thinclient fix + finsihed-only mod)

Edit: I just noticed that in addition to the missing options, then also there is missing the option for selecting 'and', 'or' or 'xor', in the two conditions lower down i.e. the field/dropdown is empty, so don't know what it defaults too, as haven't tested it really. It was also like this in previous version I posted btw. I'm not good at fixing stuff like that unfortunetly, but did though make another post to springjools on his github to make note of these extra things.

Edit2: Okay got it fixed anyways, so now 'and/or' is available in GTKUI also, and working, but the 'xor' still misses though - It needed 4 changed lines and all credits again to tote94 as I gotten the correct code from analyzing his and checking error output.

AutoRemovePlus-0.6.15-py3.9.egg (GTKUI prefs fix)

AutoRemovePlus-0.6.15-py3.9.egg (GTKUI prefs fix + thinclient fix)

AutoRemovePlus-0.6.15-py3.9.egg (GTKUI prefs fix + thinclient fix + finsihed-only mod)

Edit3: Springjools replied he's very busy at work currently, but will look at it in weekend maybe, or when time allows :)

Edit4: I fixed an issue more, so now there is 'xor' in addition to 'and' and 'or'.
Last edited by mhertz on Thu May 06, 2021 11:53 pm, edited 1 time in total.
mhertz
Compulsive Poster
Compulsive Poster
Posts: 1157
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: [Plugin] Auto Remove Plus v0.6.1

Post by mhertz »

I updated the 3 previous fixed builds of springjools fork to support labelplus instead of label plugin, which I saw requested previously here a few times before.

Note, I did only quick test by using a print statment to output the labelplus label so I could see it had worked, and I saw it got the label during manual labeling and auto'labeling, but not check anything else, i.e. sublabels or whatever named etc. I didn't bother change the debug-logging, which states "label plugin" in some of it's outputs, but these messages always refers to labelplus in these builds now however.

I originally didn't wanted do this, as I saw mgaulton's labelplus fork had support for adding labelplus labels to label plugin if enabled, so I thought people could just do that, but when I tested it(mgaulton's labelplus fork), then first there where error in the call for initializing the label plugin, which I fixed, and then the lower() function wasen't used correct either, which I then fixed and then lastly error'ed out in the call to label plugin for adding labelplus label, and where I finally thought f*** it, and might as well change directly to labelplus, so also not needing people have two plugins enabled just for that single function.

AutoRemovePlus-0.6.15-py3.9.egg (GTKUI prefs fix)

AutoRemovePlus-0.6.15-py3.9.egg (GTKUI prefs fix + thinclient fix)

AutoRemovePlus-0.6.15-py3.9.egg (GTKUI prefs fix + thinclient fix + finsihed-only mod)

Btw, I made a couple edits in previous post, if missed.

Edit: I fixed an issue more, so now there is 'xor' in addition to 'and' and 'or'. I updated above links, and also updated previous posts 3 lower links with this fix.
mhertz
Compulsive Poster
Compulsive Poster
Posts: 1157
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: [Plugin] Auto Remove Plus v0.6.1

Post by mhertz »

I added some extra missing stuff to GTKUI prefs e.g. 'remove seedtime', 'pause seedtime', 'seed remove data' and 'pause torrents'. I haven't tested it in actual use, but only checked that the fields and buttons appear in GTKUI prefs and correctly updates the core-backend/config. I only made one version as was to lazy to rebuild so much, so this is the gtkui + thinclient fixed version, with including labelplus mod. I don't think the finished-only mod is very usefull, as more flexible here, i.e. this can be used for both finished and stuck torrents, as springjools intended when making it, but I can post other on request. Note, I don't yet know how make the options appear in specific order, and my many tries failed, so there is some options at the bottom which before was at the top, sorry, not good at this GTK and UI stuff at all.

AutoRemovePlus-0.6.15-py3.9.egg
mhertz
Compulsive Poster
Compulsive Poster
Posts: 1157
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: [Plugin] Auto Remove Plus v0.6.1

Post by mhertz »

I found an issue with my labelplus mod, so fixed that, plus removed seedtime limits in core.py since my GTKUI entries didn't respect them anyways(and since more flexible). Last, added hidden config-file option, finished_only, false by default, for toggling between original behaviour and finished-only torrents. I didn't want add GTKUI/webUI prefs for it, as not an official setting, and hence preferred keeping it a hidden toggle. Top seed remove/pause options have no effect if finished_only is true, as redundant(since seedtime options is available in lower two condition rules anyway, which just normally is ignored without 'finished_only=true' as for unfinished torrents i.e. ment for removing "stuck" torrents). It worked for me in quick testing.

AutoRemovePlus-0.6.15.egg

I'll edit this post(and update above link) if making more changes later, as not wanna spam this thread more.

Edit: I reconsidered and added new option in GTKUI and webUI for the finished_only mod, so no longer hidden config-file toggle only. Also removed the limits in webUI for seedtime remove/pause and 'over' options, to match GTKUI and be more flexible.

Edit2: I added new option, 'max2min' in config-file, GKTUI and webUI, in two latter named ''Rule1 max2min". As title, it restores original plugin's behaviour(and tote94's fork) where rule1 features a 'min' condition and not a 'max'(less than/under in GTKUI/webUI), e.g. as been requested before, and imho makes sence for added flexibility - also especially in combination with my 'finished_only' option etc.
Bobby
Member
Member
Posts: 43
Joined: Wed Aug 05, 2020 7:37 pm

Re: [Plugin] Auto Remove Plus v0.6.1

Post by Bobby »

What is latest version there is working with deluge 1.3.15 ? i am thinking maby its the one in the first post, but also not sure I have AutoRemovePlus-0.6.1-py2.7 but i am not sure its the latest one working with deluge 1.3.15

@mhertz sorry boddy :)

But can we can an updated version of this, there works with the updated time setnings for deluge 1.3.15 like the pics above ? So if if set the remove timer to 1 it removes torrent after 1 hour instead of 1 day etc ? i am sure you understand what i am saying :)
Post Reply