deluge-autoremoveplus icon indicating copy to clipboard operation
deluge-autoremoveplus copied to clipboard

Not removing completed torrents with specific rules (Was: Not actually removing anything)

Open GodsVictory opened this issue 5 years ago • 14 comments

Settings:

image

image

I have 3 labels that the specific rules are tied to, each with a seed ratio and seed time setting.

These settings don't seem to remove anything, what do I have wrong?

GodsVictory avatar Jan 15 '20 15:01 GodsVictory

How do you know it doesn't remove anything? Can you upload the logs?

springjools avatar Jan 15 '20 15:01 springjools

I haven't tested this so I may be wrong but if the torrent is paused does the seedtime continue to progress? I don’t think your seedtime will ever get to 24 hours if the torrent pauses at 20 hours.

wgstarks avatar Jan 15 '20 15:01 wgstarks

Yes you're right about that. If the torrent is paused it doesn't download or seed. I prefer to pause torrents so that I can manually check that things work as planned. There is also the 'age in days' function that was planned to work better, but I have noticed that if deluge crashes, then all torrents are re-added on load and then this age resets.

For me deluge 2.03 crashes frequently.

springjools avatar Jan 15 '20 15:01 springjools

Do the specific rules not take priority over the general settings?

GodsVictory avatar Jan 15 '20 15:01 GodsVictory

Here is an example torrent that has been completed since the 13th. My goal is to have autoremoveplus remove it after 8 hours of seed time, which this one has surpassed:

image

GodsVictory avatar Jan 15 '20 15:01 GodsVictory

I think the minimum time is 20 hours. Check if it has been removed by then :)

springjools avatar Jan 15 '20 15:01 springjools

Well, since it's now the 15th, it's been well over 20 hours

GodsVictory avatar Jan 15 '20 15:01 GodsVictory

Yes, true. Well, can you paste the logs somewhere. The specific rules should take priority over general rules, but there was a lot of rewriting this plugin since it was created. There was this one modification that changed it to only apply to incomplete downloads, and then I added the completed download removal again. This is a separate check that's only managed by the seedtime settings.

Should probably rewrite the whole plugin because people use it in very different ways.

springjools avatar Jan 15 '20 15:01 springjools

05:40:30.871 [DEBUG   ][autoremoveplus.core           :449 ] Now processing name = <REDACTED>, type = <class 'str'>
05:40:30.871 [DEBUG   ][autoremoveplus.core           :233 ] Space: 1301.59423828125/-1.0
05:40:30.871 [DEBUG   ][autoremoveplus.core           :296 ] Get_torrent_rules: returning rules for c7b3f408c1785a8eabf10224508994e89caf9887: [('or', 'func_seed_time', 8), ('or', 'func_ratio', 1)]
05:40:30.871 [DEBUG   ][autoremoveplus.core           :88  ] Get ratio: i = c7b3f408c1785a8eabf10224508994e89caf9887, t = <deluge.core.torrent.Torrent object at 0x7f39d5295910>
05:40:30.871 [DEBUG   ][autoremoveplus.core           :93  ] Age in hours called: i = c7b3f408c1785a8eabf10224508994e89caf9887, t = <deluge.core.torrent.Torrent object at 0x7f39d5295910>
05:40:30.872 [DEBUG   ][autoremoveplus.core           :96  ] Now = 1579088430.8716354, added = 1578947381
05:40:30.872 [DEBUG   ][autoremoveplus.core           :98  ] Returning age: 1.6325216624471877
05:40:30.872 [DEBUG   ][autoremoveplus.core           :584 ] Fin.: <REDACTED>, seed time:36.56361111111111/24.0, ratio: 0.13367084960131662, spec. rules = [('or', 'func_seed_time', 8), ('or', 'func_ratio', 1)], sr cond. = False/False,isfinished = True, hash = C7B3F408C1785A8EABF10224508994E89CAF9887

GodsVictory avatar Jan 15 '20 15:01 GodsVictory

Ok, I see the error. The error is that the seed_remove condition is False, which it shouldn't be, since seed time is 36. I have to investigate and see what causes this. Tbh I didn't test the specific rules enough, there was a hurry to release this plugin for deluge 2.0.3.

springjools avatar Jan 15 '20 16:01 springjools

Need to test this some more: it's due to the lambda functions not seeing the remove condition. I didn't write that code, just made them work with python 3. (This was probably what was blocking making this plugin compatible with python 3 in the first place).

springjools avatar Jan 18 '20 15:01 springjools

Hi all,

First off thanks for the great work on this and keeping the dev going on this handy plugin for Deluge. I think I'm having similar problems as stated here but this sort of stuff isn't my forte so bear with me!

I'm running AutoRemovePlus-0.6.11-py3.8.egg on the latest release of binhex/arch-delugevpn so in Deluge 2.0.4 with python 3.8. I've moved countries so my NAS (running docker) had been offline for the best part of a year so I've been trying to fix everything after starting it up again, I'm nearly there I think. Phew.

It took me ages to get AutoRemovePlus to do remove anything at all but I think I've fixed most of it and now I'm maybe just misunderstanding how it works or there is a bug. My current settings are below (I intend to up the max ages and ratio once it is working as I'd expect). Do the customisable settings only come in to play after the 'pause after seedtime' and 'remove after seedtime' thresholds are hit and if so why are the minimum settings 20 and 24 hours respectively? That kind of defeats the point of the other settings that could be configured with lower values doesn't it?

Also do I need to configure the API links to Sonarr and Radarr? Maybe that is a factor but I don't understand what they are for. Currently, If I delete a download in the Sonarr queue or in the Deluge queue, it automatically removes it in the other.

Lastly what is the purpose of the 'remove also data for completed torrents'? I thought this plugin would only take action on completed torrents anyway so how does that differ from the setting 'Remove torrent data'?

Apologies for posting here if it is not the correct place. I've looked at all sorts of links but a lot of the info is old or doesn't answer the above and the problems I'm having seem relevant to this issue.

2020-02-23_20-20-45

Devo-McDuff avatar Feb 23 '20 20:02 Devo-McDuff

Okay, so you have many questions and here are some answers:

  • It doesn't only remove completed downloads. It did so originally but then it was modified to remove only not finished downloads, by someone else. Then all those plugins stopped working because nobody updated the code to work with python3 (and deluge 2.0 and up). So I did that modification and added the code for handling both unfinished and finished downloads. A lot of people, including me, use this plugin to remove stuck downloads that will never finish.
  • In case you remove unfinished downloads: there's no point in just removing it from deluge, because sonarr will just download the same file again. You need to blacklist it too. This can only be done with the function to sonarr api that removes the download from deluge. There is no stand-alone blacklist function in sonarr. So you cannot remove it in deluge and blacklist it in sonarr, because then deliuge will crash. You have to do this using the sonarr api only. This is true today but may change in the future. -There should be an option to not use the api links. Just disable them. Unfortunately, I think the plugin still needs you to install the requests library. Maybe that should be fixed if it's somehow possible.
  • The minimum seeds time of 20 and 24 hours are something I left in place from previous versions. It's simply to prevent very short seeding times, which would make deluge less usable for others.
  • Oh, lastly: there are some shortcomings in the code because people were anxious of having this plugin working so I did it fast with just the minumum functionality working.

springjools avatar Feb 24 '20 16:02 springjools

Thanks for the reply, much appreciated.

  • If something is stagnant I normally remove it in Sonarr and mark it as blacklisted when doing so. But if I understand you correctly, you mean the API functionality is so removing a download in Deluge will automatically blaklist it in Sonarr. Is that correct? That would be cool if so, though not essential, just a nice bonus. When you specify the server, shouldn't there be an option for each type? (Radarr, Sonarr etc.). My settings are below but I don't know if I'm supposed to add the port to the IP? I guess this bit is work in progress though. Also I think I read on a post somewhere that the binhex/arch-delugevpn latest build includes requests now and futures which was causing problems not being there

2020-02-25_07-43-34

  • I was wondering if it was something about enforcing good behaviour with the minimum seed times. I'm fine with that but I'm just trying to understand how the settings work together. I never want it to pause seeded torrents so am I right to just make sure the pause is higher that the remove as in my posted settings? Basically does the remove after seedtime (minimum) setting work independently of the other settings so if this is set to 24 hours, after a torrent has completed and seeded for 1 day it will be deleted (along with the data as I have the bottom checkbox ticked) and what the customisable over/under settings are below?

  • Will the customisable under/over settings, do these apply to just incomplete torrents then or both? i.e. if the 24 hours period for the completed torrents is reached will it then only remove if the rest of the criteria in these settings is also hit? (similar to my last question). If they apply to just incomplete torrents, I must have configured it wrong as I have torrent that have been ongoing for more than 1 day (longest is 70 days at 99% and there are no seeds so it will likely never complete) but it hasn't been removed

Devo-McDuff avatar Feb 25 '20 08:02 Devo-McDuff