springjools / deluge-autoremoveplus

Auto removing of deluge torrents
43 stars 5 forks source link

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

Open GodsVictory opened 4 years ago

GodsVictory commented 4 years ago

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?

springjools commented 4 years ago

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

wgstarks commented 4 years ago

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.

springjools commented 4 years ago

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.

GodsVictory commented 4 years ago

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

GodsVictory commented 4 years ago

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

springjools commented 4 years ago

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

GodsVictory commented 4 years ago

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

springjools commented 4 years ago

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.

GodsVictory commented 4 years ago
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
springjools commented 4 years ago

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 commented 4 years ago

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).

Devo-McDuff commented 4 years ago

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

springjools commented 4 years ago

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

Devo-McDuff commented 4 years ago

Thanks for the reply, much appreciated.

2020-02-25_07-43-34