Page 3 of 3

Re: What Is 20 Minutes?

Posted: Tue Feb 28, 2023 8:37 pm
by chnaski
basher wrote: Tue Feb 28, 2023 11:37 am Ye, just grab the latest .egg and replace it with your current ARP egg. As long as you're using deluge 2 and py 3.7+ it's going to be fine.
This would be an example of config that runs every 19 minutes and removes autodl labeled torrents that have seeded for at least 20 minutes.
Note if you want it to use labels set by labelplus plugin, then flip the labelplus value to true.
autoremoveplus.conf:

Code: Select all

{
  "file": 1, 
  "format": 1
}{
  "labels": [], 
  "hdd_space": -1, 
  "use_quota_for_free_space": false,
  "label_rules": {
    "autodl": [
      [
        "or", 
        "func_seed_time", 
        0.333333
      ]
    ]
  }, 
  "tracker_rules": {}, 
  "enabled": true, 
  "force_reannounce_before_remove": true, 
  "skip_removal_on_reannounce_failure": true, 
  "reannounce_max_wait_sec": 30, 
  "remove": true, 
  "remove_data": true, 
  "labelplus": false, 
  "rule_1_enabled": false, 
  "rule_2_enabled": false, 
  "min": 2.0, 
  "min2": 0.0, 
  "sel_func": "or", 
  "count_exempt": false, 
  "filter": "func_seed_time",
  "filter2": "func_seed_time", 
  "max_seeds": 0, 
  "trackers": [], 
  "interval": 0.316667
}
Ok, thanks so much.
I used your egg, this .conf file, and the 'AddTorrentCheck' plugin so it's deleting everything after 20 minutes of seeding.

Re: What Is 20 Minutes?

Posted: Tue Feb 28, 2023 8:40 pm
by chnaski
basher wrote: Tue Feb 28, 2023 3:59 pm
mhertz wrote: Tue Feb 28, 2023 3:52 pm If I remember right then I fixed it to work for idiocracy in the first unofficial windows installer thread, and I can't remember but saw a snippet posted using time.sleep(), which stalls whole deluge main UI thread if not remember wrong, so twisted reactor.callLater() or alike preferred I'd guess, but nonetheless, thanks :)
The very last egg in the thread you posted already uses LoopingCall from twisted.internet.task, so looks like it's there.
And that you for this.
I used that egg as well

Re: What Is 20 Minutes?

Posted: Tue Feb 28, 2023 8:46 pm
by mhertz
I briefly looked at the plugin, nice! Kudos to Kaavi and idiocracy! :) I remember now that I just updated it to deluge2 and not anything else(in another old thread with idiocracy, or maybe PMs, but whatever).

Anyway, I just made a small change to not have the loop run every 2 secs and restart sleep every 5 therein, little counter-intuitive, and additionally I noticed that indeed the sleep blocks. Well obviously, but I thought that when run in a subprocess ala loopingCall or callLater from twisted, then alright, but no it still blocks - I usually use callLater with the timeout as a sleep replacement, so didn't know. you can check with adding any torrent in paused mode and moving mouse up and down e.g. in the top menus, which doesn't react when pause happens i.e. you cannot control GUI whatsoever.

So now initially and every 5 secs loop runs, without blocking. Maybe should add a couple options for sleep and breakoff-time, but meh works fine as is I guess, plus basher could do that in his sleep if wanted :)

AddTorrentCheck-0.2.egg

Edit: Came to think about first reannounce happens imidiately, will change that later, tomorrow evening properly. Actually an even quicker way fix that, is giving 'False' arg to loopingCall, so runs not initially also, but first at interval time, here after 5 secs, so mimicks old behavior. Later as said, or if basher beats me. Also I will setup github repo for it tomorrow too, if basher needs anything.

Re: What Is 20 Minutes?

Posted: Tue Feb 28, 2023 9:45 pm
by chnaski
basher wrote: Tue Feb 28, 2023 12:44 pm
chnaski wrote: Tue Feb 28, 2023 12:35 pm Alternatively, what if I wanted to delete any torrent labeled autodl after 20 minutes whether it’s been seeding for twenty minutes or not?
Just like remove any torrent from the time it was added to twenty minutes later
Assuming you still want the download to finish, then you could still use seed-time rule with value of 0. If you want to remove torrent regardless of its status after 20 minutes it's been added to your client, you'd need to use func_added rule, but note that is configured in days not hours.
ok so this?

Code: Select all

{
    "file": 1,
    "format": 1
}{
    "count_exempt": false,
    "enabled": true,
    "filter": "func_added",
    "filter2": "func_added",
    "force_reannounce_before_remove": true,
    "hdd_space": -1,
    "interval": 0.013888,
    "label_rules": {
        "autodl": [
            [
                "or",
                "func_added",
                0.013888
            ]
        ]
    },
    "labelplus": false,
    "labels": [],
    "max_seeds": 0,
    "min": 2.0,
    "min2": 0.0,
    "quota_executable": "/usr/bin/quota",
    "reannounce_max_wait_sec": 30,
    "remove": true,
    "remove_data": true,
    "rule_1_enabled": false,
    "rule_2_enabled": false,
    "sel_func": "or",
    "skip_removal_on_reannounce_failure": true,
    "tracker_rules": {},
    "trackers": [],
    "use_quota_for_free_space": false
}

Re: What Is 20 Minutes?

Posted: Tue Feb 28, 2023 11:24 pm
by mhertz
Here's the small fix I talked about previously(fixed fix):

AddTorrentCheck-0.2.egg

Github repo:

https://github.com/mhertz/deluge-AddTorrentCheck

Re: What Is 20 Minutes?

Posted: Wed Mar 01, 2023 10:08 am
by basher
mhertz wrote: Tue Feb 28, 2023 8:46 pm Anyway, I just made a small change to not have the loop run every 2 secs and restart sleep every 5 therein, little counter-intuitive, and additionally I noticed that indeed the sleep blocks. Well obviously, but I thought that when run in a subprocess ala loopingCall or callLater from twisted, then alright, but no it still blocks
Nice job, will check in some days, possibly weekend.
Your intuition with sleep() not blocking UI thread in loopingCall subprocess matches mine - wouldn't have thought it blocks!
mhertz wrote: Tue Feb 28, 2023 8:46 pm Maybe should add a couple options for sleep and breakoff-time, but meh works fine as is I guess, plus basher could do that in his sleep if wanted :)
Ha, don't sell yourself short. And trust me, I'm not a python developer, sure am doing plenty mistakes there myself.

Re: What Is 20 Minutes?

Posted: Wed Mar 01, 2023 10:10 am
by basher
chnaski wrote: Tue Feb 28, 2023 9:45 pm ok so this?
Yup, that should do it.

Re: What Is 20 Minutes?

Posted: Wed Mar 01, 2023 12:03 pm
by mhertz
@basher, Thanks for saying that, appreciate you :)

@chnaski, I do apologize for off-topic'ness, somewhat, sorry mate :) I should have posted in the other thread obviously, sorry.

Re: What Is 20 Minutes?

Posted: Thu Mar 02, 2023 6:50 am
by chnaski
mhertz wrote: Wed Mar 01, 2023 12:03 pm @basher, Thanks for saying that, appreciate you :)

@chnaski, I do apologize for off-topic'ness, somewhat, sorry mate :) I should have posted in the other thread obviously, sorry.
No worries