Hello!
I am attempting to use deluge-console with "pause *; quit" and have run into the following issues:
It doesn't pause all torrents (queued torrents remaining queued) - v2.0.5,v2.0.3, v1.3.13
They resume after reboot by themselves (only when paused via console - web-gui paused ones do not resume) - v2.0.5,v2.0.3, v1.3.13
I cannot resume them via the web-gui (resume works from console if paused via console). - v2.0.5,v2.0.3, v1.3.13
Any resolutions to the above?
Thanks,
--CP
deluge-console
Re: deluge-console
Very interesting, nice catch and thanks for posting.
I haven't yet looked into if i'm able to see why this happens, but however found solution during testing this.
If using "**", instead of "*", then all your issues fixed in my testing i.e. also queued torrents paused/resumed, resuming can be done in web-ui for torrents paused from consoleUI, and finally that restarting should keep pause state, atleast 'deluge-console halt; deluged; deluge-console info' shows that '[P]' state retained here. All these 3 scenarious failed before when using "*" as per you found/posted.
Btw, I don't know why so many places lists that ';quit' at end of console-ui command-sequences - it's non-interactive-mode hence quiting done by default anyways, so I always omit such myself, though not important.
Thanks again for informative post/issue raised
Edit: Ohh it's because arg "*" is triggering a 'core.pause_sesion()' function-call, and not the standard otherwise used 'client.core.pause_torrent()' call, meaning '*' triggers session pausing and not torrent pausing persay, which was why web-ui couldn't resume torrents as whole session paused. Anyway, globs other than that is matched against 'self.console.match_torrent()', which runs a string.startswith('*') and/or string.endswith('*') and filters torrent-names+ids with such and then as previously mentioned pausing those through 'client.core.pause_torrent()'.
Edit2: This was btw tested with deluge v2.x(2.0.5). In the old deluge 1.x console-ui there was only used 'string.startswith()' so couldn't match from e.g. middle or end of name/id, as you can now, and didn't as now need add the glob(s) specifically to trigger globbing, from said function(s).
I haven't yet looked into if i'm able to see why this happens, but however found solution during testing this.
If using "**", instead of "*", then all your issues fixed in my testing i.e. also queued torrents paused/resumed, resuming can be done in web-ui for torrents paused from consoleUI, and finally that restarting should keep pause state, atleast 'deluge-console halt; deluged; deluge-console info' shows that '[P]' state retained here. All these 3 scenarious failed before when using "*" as per you found/posted.
Btw, I don't know why so many places lists that ';quit' at end of console-ui command-sequences - it's non-interactive-mode hence quiting done by default anyways, so I always omit such myself, though not important.
Thanks again for informative post/issue raised
Edit: Ohh it's because arg "*" is triggering a 'core.pause_sesion()' function-call, and not the standard otherwise used 'client.core.pause_torrent()' call, meaning '*' triggers session pausing and not torrent pausing persay, which was why web-ui couldn't resume torrents as whole session paused. Anyway, globs other than that is matched against 'self.console.match_torrent()', which runs a string.startswith('*') and/or string.endswith('*') and filters torrent-names+ids with such and then as previously mentioned pausing those through 'client.core.pause_torrent()'.
Edit2: This was btw tested with deluge v2.x(2.0.5). In the old deluge 1.x console-ui there was only used 'string.startswith()' so couldn't match from e.g. middle or end of name/id, as you can now, and didn't as now need add the glob(s) specifically to trigger globbing, from said function(s).
Re: deluge-console
Hey Mhertz,
Thanks for the info, the "**" does make a difference on 2.0.3 and 2.0.5!
Will there be anything that works for 1.3.13? Was hoping to not update this linux box as it's working as-is and is quite old hardware...
Thanks,
--CP
Thanks for the info, the "**" does make a difference on 2.0.3 and 2.0.5!
Will there be anything that works for 1.3.13? Was hoping to not update this linux box as it's working as-is and is quite old hardware...
Thanks,
--CP
Re: deluge-console
You could script it, e.g. here's quick example:
Anyway, if specifically wanting the "**" possibility of deluge 2.x into v1.3.x, then need hack source, e.g. something along:
Code: Select all
deluge-console pause $(deluge-console info | grep -E '^ID: [a-z0-9]{40}$' | awk '{print $2}')
Code: Select all
deluge-console resume $(deluge-console info | grep -E '^ID: [a-z0-9]{40}$' | awk '{print $2}')
Code: Select all
sudo find /usr -path *deluge/ui/console/main.py -exec sed -i "s/ret.append(tid)/ret.append(tid)\n if string == '**': ret.append(tid)/" {} \;