[SOLVED] Default Filter on WebUI Login?

General support for problems installing or using Deluge
User avatar
ambipro
Moderator
Moderator
Posts: 673
Joined: Thu May 19, 2022 3:33 am
Contact:

Re: Default Filter on WebUI Login?

Post by ambipro »

Yea, I found what I think we can manipulate...

https://git.deluge-torrent.org/deluge/t ... nel.js#n78

I'd assume that the if (!state) is going to be the default, but my js experience is next to zero when it comes to web development.

I'm not sure how easy it would be to do this in a plugin, or how easy it would be to modify this (if requires a new binary or freezing affecting it) - but it should be a start.

I don't have a real concrete solution as I can't test, but changing

Code: Select all

        if (!state) return;
to

Code: Select all

         if (!state) return "Active";
Might just work.
greendude120
Member
Member
Posts: 25
Joined: Sat Nov 25, 2023 8:13 pm

Re: Default Filter on WebUI Login?

Post by greendude120 »

What about a plugin that just delays the loading of all the torrents so I have X seconds (set in the plugins menu) to click a filter? Would that be less effort? I'm certainly not trying to get someone to rewrite the code ^.^

Otherwise I can try to dig through the code and find where All is set as the default and just set that to Active. Its a more permanent and non flexible change but its still more convenient for me. If I can find that then I'll attempt to compile which ive never done.

Appreciate you guys once again, thanks.
User avatar
ambipro
Moderator
Moderator
Posts: 673
Joined: Thu May 19, 2022 3:33 am
Contact:

Re: Default Filter on WebUI Login?

Post by ambipro »

I'm pretty sure the line I just quoted is what sets the default to the same result as All being selected...but as I said I don't have a means to test this.
greendude120
Member
Member
Posts: 25
Joined: Sat Nov 25, 2023 8:13 pm

Re: Default Filter on WebUI Login?

Post by greendude120 »

ambipro wrote: Sun Nov 26, 2023 1:27 pm

Code: Select all

        if (!state) return;
to

Code: Select all

         if (!state) return "Active";
Might just work.
Changes in /js/deluge-all-debug.js does seem to reflect live on the webui meaning theres no need to recompile the windows client. I was able to brick my webui to confirm last night trying a bunch of stuff like that albeit with no js knowledge. But i had kept a backup copy ofc so i reverted to the original file and then tested what u said. I then tried your change here but it still defaulted to All unfortunately. I also found that it *seems* to be live meaning i dont need to reload deluge each time to test changes but i still did reboot it each time for sanity.
mhertz
Moderator
Moderator
Posts: 2331
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Default Filter on WebUI Login?

Post by mhertz »

Thanks for the help ambipro, appreciated!

Also to you greendude :) You can just refresh browser usually to reflect changes. All those source-files, like ambipro posted, gets included in the regular or debug version of deluge-all.js as you found, and not included in the freezing, so I only needed rebuild previously for changed py files specifically.

Will look into it later, if not beaten - and I don't think I can make a plugin for this, was a pain in the a** to get working for python for me, let alone JS/extjs.
User avatar
ambipro
Moderator
Moderator
Posts: 673
Joined: Thu May 19, 2022 3:33 am
Contact:

Re: Default Filter on WebUI Login?

Post by ambipro »

I'm not sure, but I don't think the debug is the file you'd modify....since it minify's it (I'm not sure if it's at runtime though) then that would be where the change needs to be...
mhertz
Moderator
Moderator
Posts: 2331
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Default Filter on WebUI Login?

Post by mhertz »

On linux, there's both debug and regular, and the regular a pita to edit, so one can rename the regular to get the debug to take precedense and be read instead, or just edit the main non-debug. On windows, there's only one of these, the debug, and even adding a non-debug I believe is dismissed regardless from experience, unless remember wrong, but anyway, it is the debug to edit on windows, provided such before several times atleast. Don't know anything about minify and whatnot, but just that this works however. The change unfortunetly returns active to always be there, despite not etc. - thanks though! :)

If not carring about the state listing wrong etc, then can just run ambipro's first suggested line in a plugin presumably - maybe not even will list filters wrong(e.g. list all instead of active), and maybe just was issue of gtk-ui.
User avatar
ambipro
Moderator
Moderator
Posts: 673
Joined: Thu May 19, 2022 3:33 am
Contact:

Re: Default Filter on WebUI Login?

Post by ambipro »

I'll look more later, no promises.
greendude120
Member
Member
Posts: 25
Joined: Sat Nov 25, 2023 8:13 pm

Re: Default Filter on WebUI Login?

Post by greendude120 »

mhertz wrote: Sun Nov 26, 2023 6:33 pm If not carring about the state listing wrong etc, then can just run ambipro's first suggested line in a plugin presumably - maybe not even will list filters wrong(e.g. list all instead of active), and maybe just was issue of gtk-ui.
Ya i wouldnt care as that would effectively give me the time I need to then switch to the desired state which is infinitely faster than waiting a minute to do any action. Would LOVE that.
ambipro wrote: Sun Nov 26, 2023 6:38 pm I'll look more later, no promises.
ty guys for looking into this , much appreciated
User avatar
ambipro
Moderator
Moderator
Posts: 673
Joined: Thu May 19, 2022 3:33 am
Contact:

Re: Default Filter on WebUI Login?

Post by ambipro »

I'd always suggest you use thin client over webui if you can...
Post Reply