[Plugin] ltConfig v2.0.0

Suggest, post, or discuss plugins for Deluge
basher
Leecher
Leecher
Posts: 94
Joined: Wed Sep 29, 2021 8:42 am
Location: Estonia/Spain

Re: [Plugin] ltConfig v2.0.0

Post by basher »

ambipro wrote: Sun Aug 06, 2023 3:12 pm All that aside, I do think that active_tracker_limit is a pretty useless/niche feature....the setting of this to a default value that is not unlimited seems counter to almost every use case. I think the vast majority would be better suited with unlimited, and the OPTION to set (just check if an integer) to some arbitrary value.
100% this. Very few users would be interested in this, and I'd argue most would assume it's unlimited by default. I sure did.
User avatar
ambipro
Moderator
Moderator
Posts: 445
Joined: Thu May 19, 2022 3:33 am
Contact:

Re: [Plugin] ltConfig v2.0.0

Post by ambipro »

basher wrote: Sun Aug 06, 2023 3:29 pm
ambipro wrote: Sun Aug 06, 2023 3:12 pm All that aside, I do think that active_tracker_limit is a pretty useless/niche feature....the setting of this to a default value that is not unlimited seems counter to almost every use case. I think the vast majority would be better suited with unlimited, and the OPTION to set (just check if an integer) to some arbitrary value.
100% this. Very few users would be interested in this, and I'd argue most would assume it's unlimited by default. I sure did.
I went to github, and found this which states -1 can be set, perhaps we should either have this option default in all ltConfig configurations, or have deluge natively set it? Or set to "Total" in preferences under Active Torrents, if that value is also not -1...

Either way, debating whether this should be opened as an issue on github, I found no other requests for this, just people having the issue stemming from the limit, to which they were told (eventually) that this was the cause. this link for related issues
mhertz
Moderator
Moderator
Posts: 2216
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: [Plugin] ltConfig v2.0.0

Post by mhertz »

Btw, this was changed in qbittorrent long ago I see, to match active torrents selected, pretty nice.

Anyway, there's a deluge old ticket for this here too: https://dev.deluge-torrent.org/ticket/2257 (Still unimplemented)

You can ask @libtorrent if they wanna up it, or for the preset, I know Arvid said before PRs appreciated for optimizations. I would guess there's a reason for it being configurable, but up it would be nice sure.

You can ask ltconfig dev, but find it out of scope personally, unless adding unofficial preset, but not it's dev of-course :)

Edit: It's configurable to limit/control resource-usage as this option has a cost(dht more than tracker though), probably because general purpose lib intended also support low-end embedded devices too.Manual suggest -1 as ambipro said if not wanting such limitation, like here.

Edit2: I politely bumped the deluge ticket, suggesting -1 making sence without needing possibility to change in deluge specifically - also I was mistaken in saying qbittorrent defined these limits from all torrents allowed(active_limit) sorry. They used to do such, but later changed to hardcoded -1 for all I now see.
mhertz
Moderator
Moderator
Posts: 2216
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: [Plugin] ltConfig v2.0.0

Post by mhertz »

I fixed mouse-clicking checkboxes on my ltconfig build with updated high-performance-seed preset(up-to-date as per libtorrent 2.0.9/1.2.19 currently, but fine in older versions too):

ltConfig-2.0.0.egg

Edit: Small fix to above.
lisbian08
New User
New User
Posts: 2
Joined: Wed Nov 01, 2023 9:56 pm

Re: [Plugin] ltConfig v2.0.0

Post by lisbian08 »

I attempted to add the plugin into Deluge running on my Synology NAS. Deluge version 2.1.1.61-23. Several attempts to load the plugin have failed. I thought it would be a fairly simple process. I am new to this. Any suggestions would be greatly appreciated.
mhertz
Moderator
Moderator
Posts: 2216
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: [Plugin] ltConfig v2.0.0

Post by mhertz »

There's a bug with installing plugins from webui, so need either do manually through copying plugin into deluge profile dir(in 'plugins' subfolder), or try install from GTK-UI(e.g thinclient mode, as in your case). For synology, I don't know where deluge profile dir at, well it's easy Google'ble but you need to access it through either some file-manager or terminal app on it, or through ssh/ftp etc.

(Last I spent a couple of hours on it, was over my head why borked out when running api call. Need actual devs to fix. Webui plugin install bug I mean - I can't remember if also is issue in GTK-UI on second thought)
lisbian08
New User
New User
Posts: 2
Joined: Wed Nov 01, 2023 9:56 pm

Re: [Plugin] ltConfig v2.0.0

Post by lisbian08 »

Thank you!!! I used Putty and copied the file via SSH to the directory and got it to work that way. I was unaware of the WebUI bug.
mhertz
Moderator
Moderator
Posts: 2216
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: [Plugin] ltConfig v2.0.0

Post by mhertz »

@lisbian08, Good job, and you're much welcome buddy, you did the job yourself even, kudos :)

@all, Sorry off-topic, but since brought up here anyway, then just wanted add I fixed the web-UI plugin-install issue and created a bug-ticket with code-fix suggestion.

Meanwhile if wanted then this command-line will apply fix to linux-install(can keep deluge-web running if wanted, but need refresh open webpage to it then, before will work):

Code: Select all

sudo find /usr -path "*/deluge/ui/web/js/deluge-all.js" -exec sed -i "s/\..'),},/..'),},listeners:{fileselected:function(fb,v){this.setValue(v[0]['name']);}},/" {} \;
Alternatively, here's prepatched deluge 2.1.1 file for linux. (e.g. '/usr/lib/python3.11/site-packages/deluge/ui/web/js/deluge-all.js')

Same for windows. ('%programfiles%\deluge\ui\web\js\deluge-all-debug.js')
(Luckilly this file was omited picked up by pyinstaller during freezing, so supplied externally, so I need not supply prebuilt exe for this fix.)

Hope helps.

Edit: I broke torrent-file-upload first time, sorry about that, replaced fix above, with more direct one which shouldn't break anything else. I might change it again later, as still a minor cosmetic issue left, showing wrong filename after selecting, but corrects itself alterwards and so non-functional issue. If ran that first command-line, without backup, then this will revert back to default: 'sudo find /usr -path "*/deluge/ui/web/js/extjs/ext-extensions.js" -exec sed -i "s/setValue(value\[0]\['name'])/setValue(value)/" {} \;'.

Edit2: Sorry last edit, I fixed the minor cosmetic bug and replaced command-line and files above with final fix, sorry for inconvinience. If ran the previous command-line from previous edit, without backup, then can revert back to default with: 'sudo find /usr -path "*/deluge/ui/web/js/deluge-all.js" -exec sed -i "s/findField('file').value\[0]\['name']/getFieldValues().file/" {} \;'.
bengalih
Leecher
Leecher
Posts: 56
Joined: Fri Feb 14, 2014 3:31 am

Re: [Plugin] ltConfig v2.0.0

Post by bengalih »

mhertz wrote: Tue Aug 25, 2020 8:01 pm Firstly, thanks for the space-bar "trick", I never knew that, and have always stated to people that toggling such from GTK-UI wasen't supported currently, doh, fell like a moron now, lol, but certantly appreciate the headsup, thanks mate! :) I also now posted this tip in the ticket I posted a while back on ltconfig's github to initially report this. And yes, definetely works, when recording toggled value in conf correctly.

Indeed, this is seeimgly troublesome, and i'm much baffled about this, and even more about why I cannot reproduce and you can??? Could you please in the last step start deluge with debug-logging enabled and post the log, or parts of it(regarding obtained/defined settings)? If using the windows unofficial client, then open command-prompt in deluge-install-folder and run 'deluge -L debug -l %userprofile%\deluge.log'.

Edit: On second thought, libtorrent saves current state of several things, including settings, or atleast sub-set of them, in session.state file, which then is loaded again by libtorrent at startup. As said I couldnt reproduce and also checked/searched-through session.state if it included any of these options tested here, which didn't, but I suspect this is the cause, which ltconfig cannot really be blamed about, and if i'm right in above, then as workaround you could at same time also delete session.state, which is fine and harmless, e.g Cas once suggested to do that as workaround for a deluge crashing bug. Anyway, just a thought, and if correct, then I'm sorry for the previously wrong statement of mine about only ltconfig.conf being the relevant part.
I'm replying to this conversation from years ago because it reared its ugly head again and I think that either some more needs to be done to Deluge to limit this behavior, or else this information needs to be posted more publicly in documentation, etc.

You can reference my newer post here:
viewtopic.php?t=56724

In short, the fact that ltconfig information gets cached in session.state causes all sorts of issues. In this case, even though I had removed and verified that the "disable_hash_checks" setting was no longer in my ltconfig.conf file, it was apparently still going into effect because it was in session.state. Couple this with the fact that the Deluge UI was still showing torrents running through a hashing process and reporting 100% (albeit apparently more quickly) gave the impression that torrents were properly being hashed. This led to incorrectly reporting to trackers that my client was seeding a copy that passed the hash. Dangerous and embarrassing.

TBH, I'm not sure I ever saw this last reply by mhertz at the time (I don't seem to have responded), so I might not have known about his explanation of the session.state until now when I just remembered I had previously posted about strange inconsistencies and came back to check on this thread. The fact that someone as sagacious as mhertz didn't even make the connection that ltconfig settings were possibly being stored in session.state until several back and forths (as is evidenced by his apology for making a wrong statement), shows that this information is just not widely known.

I really think we need some more clarification about the session.state file. Why is it necessary? If it can be deleted with no ill effects, why doesn't deluge delete it as a safeguard upon every reboot/shutdown? If Deluge won't incorporate this function, is it safe for users to manually script and if so, shouldn't we be notifying them to do so based on these dangers?

It seems clear from testing (at least on my Windows configuration) that modifying the ltconfig file directly (which was also suggested by mhertz due to the GUI bugs with the thick client) will not indeed clear any settings out of the session.state. Even though these settings were not in my ltconfig.conf file and even though my client (and system) was relaunched many times, these settings persisted.

I can't believe I'm the only person that a) experienced this and b) finds the behavior problematic. I understand there are both technical and time constraints to implementing a solution that might avoid this, but it isn't as difficult to ensure that this information is put out there more easily for people to find. For one, adding text to the ltconfig plugin itself under the settings with a warning about the session.state file would be very beneficial and inform users and hopefully prevent this from happening again.
mhertz
Moderator
Moderator
Posts: 2216
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: [Plugin] ltConfig v2.0.0

Post by mhertz »

Nothing new, just didn't wanna come fourth as a total weirdo lol, (inside-joke), so hence I forked ltconfig and added my old fixes for updated high-performance-seed preset and mouse-clicking checkboxes: https://github.com/mhertz/deluge-ltconfig

I answered bengalih's post here: viewtopic.php?p=237831#p237831

Thanks guys, and gals :)
Post Reply