[SOLVED] Default Filter on WebUI Login?

General support for problems installing or using Deluge
greendude120
Member
Member
Posts: 23
Joined: Sat Nov 25, 2023 8:13 pm

Re: [SOLVED] Default Filter on WebUI Login?

Post by greendude120 »

mhertz wrote: Sun Dec 17, 2023 1:59 pm @greendude120, Sorry bro, I cannot reproduce, so probably a case of for some reason not working with many torrents, for whatever reason. I tested that newest webui file on linux, windows and my phone, though only 5 torrents loaded but phone is a 150 dollar android motorola g20, so low spec indeed, like my computer(i'm little cheap honestly lol). It always here goes to second filter, so always 'Active' selected at startup/refresh with sidebar_show_zero enabled, and else whatever else number 2 in filter-list. No jumping around or other crazyness observed here neither. As said, will return if thinking of some more, and will still on/off work little on seeing if can make plugin as said. Sorry bro, really would like to help you, I can tell you're a good guy, so hence, and not that happy about it honestly, but what can you do. In meantime, take care :)
Ya the problem is that even if your phone is slow, webui will have no issues loading just 5 torrents so you could actually be presented with the ACTIVE filter and yet still stuck waiting for responsiveness like i am, just like miliseconds for you and tens of seconds for me. Cause I definitely see Active be switch on but i still cant click Add Torrents button or if i manage to do it fast enough i still cant paste a link and add until the full 50 secs or so has gone thru. For me ACTIVE is on and yet even active's torrents dont show up until its all fully loaded because the ALL filter has already begun its thing just prior or simultaneously so the loading is already in motion and cant be stopped. On PC with your original .js though its all fine as i had reported. Its able to get out of the hiccup and be responsive only a second or two after switching to ACTIVE.

I dont think there is any solution to this other than literally having full control over the ability to pause loading torrents on ALL. Like if u could literally tell Deluge to wait loading them, switch to ACTIVE, wait another bit just in case browser is slow and then load all, then it should work. but i think instead it must be happening in parallels or even after the fact.

Again I thank you for your incredible patience and resilience with this. I realize you are putting in your time and effort into a problem that will only affect very few extreme users like myself. If you wish to have a faster back and forth session im happy to add you on Discord or something too. Otherwise I'm happy to just keep checking this thread periodically and testing anything you post.

And of course I wont be upset if you give up so dont feel bad. You already improved my experience on my phone so im already thankful.
User avatar
ambipro
Moderator
Moderator
Posts: 445
Joined: Thu May 19, 2022 3:33 am
Contact:

Re: [SOLVED] Default Filter on WebUI Login?

Post by ambipro »

Yep, that's what I'm experiencing too, active is selected, however, it's still loading "All" - which for me takes about 30s due to there being many thousands of torrents.

Once "All" finished loading into the client, it then loads Active usually, then empty states and stuff disappear.

I just disabled it for now, as it appeared to not be functioning as intended :(

Sorry mhertz
mhertz
Moderator
Moderator
Posts: 2215
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: [SOLVED] Default Filter on WebUI Login?

Post by mhertz »

@greendude, Thanks for the detailed report and thoughts and nonethelest your really kind words, appreciated alot my friend :) I will think about it some more, e.g good idea you got, I.e maybe pausing the session and then switching filter, and resume session, hmm I'm not sure I can do that actually, I mean switch filter after whole session paused, but quick thought. I really appreciate the discord offer, thanks alot my friend, but im really bad at such, having some pretty big social anxiety issues to be little too honest, but means alot to me the offer, thanks! :) I post later on if thinking of something, thanks bud.

@ambipro, appreciate you as always bro! :) (Edit: Didn't even see your second last message on previous page till now, don't know why since clicked "show unread" or how called - thank you my friend! :) )
mhertz
Moderator
Moderator
Posts: 2215
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: [SOLVED] Default Filter on WebUI Login?

Post by mhertz »

@greendude120, I used your good idea, thanks, though don't know if will work for this issue or not, just works here with few torrents. It pauses libtorrent session(pauses all torrents), swicthes filter to active(when sidebar_show_zero enabled, as you have), and then waits 5 secs and resumes session. deluge-all-debug.js

Though as you previously had issues with delay added, then I also made alternative without delay. so pauses session, swicthes filter to active, and resumes session, just as alternative, as maybe delay not even needed either when doing it this way. This version is the old link I refreshed, i.e. deluge-all-debug.js

@all, If this works, then I will add it to the startfilter plugin also(gtkui for now).
greendude120
Member
Member
Posts: 23
Joined: Sat Nov 25, 2023 8:13 pm

Re: [SOLVED] Default Filter on WebUI Login?

Post by greendude120 »

Before I use it, does it resume all or does it go back to the pause/play state it was in before. Because I dont keep all 100% of my torrents on play and I want to remember which ones are paused before I try it if it will resume ALL 2000 of them :D . Thanks im excited to try it out either way! :)
mhertz
Moderator
Moderator
Posts: 2215
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: [SOLVED] Default Filter on WebUI Login?

Post by mhertz »

Good question indeed, and sorry didn't specify, as too thought of that originally and ment to test it, but ended up didn't, because the libtorrent API docs state that the pausing of session is different from pausing of torrents, just has same net effect for the pause_session() part, and then resume_session() restores the states back of each torrent in session as was before. However, I just checked also now myself, just to be completely sure, and indeed did kept the pause state here as stated, so nice, as else indeed useless.

I will continue though look for better solution I think, even though if this here ends up working, but just a step in right direction atleast, if does I mean.

Thanks likewise for testing :)
greendude120
Member
Member
Posts: 23
Joined: Sat Nov 25, 2023 8:13 pm

Re: [SOLVED] Default Filter on WebUI Login?

Post by greendude120 »

Hey good news! So when I used the 5 second delay one, I was indeed able to click the Add Torrents button and the small pop up came up and I was able to paste my link in. However, because the deluge page load as a whole eats up 2-3 seconds on my slow tablet and because I have to click the Add, Paste link then Click Add again, i didnt make it in the 5 second window so that final 'add' button didnt work and i had to wait the full minute. So this fix 100% works, i just need customizable delay. So if that can be added to the plugin ui, we have an official winner on our hands. Just to confirm, i'd be happy to try another js with a hardcoded delay of say 10 seconds before you spend more time on that.

Thanks so much for not giving up on it!
mhertz
Moderator
Moderator
Posts: 2215
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: [SOLVED] Default Filter on WebUI Login?

Post by mhertz »

Sorry been little slow lately, and sadly I have not good news, think I took my mouth to full or something, as doubt I can do this as said, but as always, if do find something when messing little more with it later, then will return of-course :)

It sounds like the switching of filter isn't really helping here(with many torrents), and so only the paused session helping you. I still haven't found how to change filter from a plugin - there's no API for such, and need interact with the relevant class in other source file from the plugin, and did so for GTK part before, but the JS part isn't as controllable for this in how setup, atleast for me. Will still try, but as said not seemingly helping with many torrents regardless, as you found.

I need look more into how filter the torrent-list, which the update_ui() doesn't do, unless i'm moron, tried that long ago. Gtk-UI has a filter-function I hooked into, for it's torrentview, but need find comparabel for webUI, but as ambipro reported, with many torrents then that even neither doesn't work regardless, only with moderate amount or less apparently, so dunno(in GTK-UI I both filtered torrent-list results and changed fillter for sidebar).

I guess I could make a webui plugin with just imidiately pausing the session and configurable delay before resuming, well infact I did, but seems little, how to put it, bad solution, but of-course just for loading up a quick torrent, then fine, but honestly, then would myself rather make a little script, adding torrent through deluge-console, or webui APIjson-rpc) though curl, or vbs/powershell natively etc. and bind it to the magnet/torrent handler in your browser, or alike. That plugin is only for webUI btw, I removed entry-points completely for GTK for now.

Anyway, sorry for getting your hopes up, but of-course could be lucky and find something, but anyway, thanks for your kind posts, if nothing else, then take care buddy :)
User avatar
ambipro
Moderator
Moderator
Posts: 445
Joined: Thu May 19, 2022 3:33 am
Contact:

Re: [SOLVED] Default Filter on WebUI Login?

Post by ambipro »

web.update_ui is filterable, although I'm not sure how you would dynamically change for only initial loading. Maybe it is possible to see if the session is new or set a variable upon starting of a session that is unset later after session is resumed?

you can pass parameter [ hash: "randomshit" ] to update_ui and it should pull nothing since no matches are found.
mhertz
Moderator
Moderator
Posts: 2215
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: [SOLVED] Default Filter on WebUI Login?

Post by mhertz »

Thanks alot bro, I didn't knew that! :) Will look into it little later - still no high hopes, when same not working for gtk-ui for you when many torrents, where do same(filter list) just with other meassures(and besides sidebar), but regardless, and indeed nice to know, thanks! :)

I tested it weeks ago, after you posted about it first. I did it both in plugin, source-file and through curl, e.g. state active, in correct formatting, and gave some output back but no change in torrent list, but apparently i'm not that good at it, no surprise though. I also found it relevant that in the docs it states update_ui is for "Gather the information required for updating the web interface." and not just for actually "updating the interface", but apparently just another way to describe it.

Anyway, appreciate the info :)

Edit: Sorry believe misunderstood you. I believe you're saying you can filter, so get output, but not specifically about filtering torrent-list shown in webUI, which sounds reasonable(grepping output for later/further usage, wherever). Sorry misunderstood and used bad wording originally :)
Post Reply