Skip to content

Schedule Pause bittorrent session with bandwidth scheduler#24443

Draft
piopodg wants to merge 1 commit into
qbittorrent:masterfrom
piopodg:pause_session
Draft

Schedule Pause bittorrent session with bandwidth scheduler#24443
piopodg wants to merge 1 commit into
qbittorrent:masterfrom
piopodg:pause_session

Conversation

@piopodg

@piopodg piopodg commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Draft of PR, which adds pause/resume session to current scheduler. Since #9203 was abandoned, I coded this because I need to pause all activities during a day, but I want to add torrents to qbt and maybe resume session for some time. Since this can be controlled via AltGlobalSpeedLimit feature, then I reused this feature.

Scope:

  • GUI checkbox for user to decide if wants to pause session during alternative time
  • WebUI controls to mirror GUI
  • workaround to apply session state during start up of qbt. Without this, qbt would start with session resumed, despite selecting to schedule pause and being in selected hours. If there is a better solution, feel free to share it.

This should satisfy anyone, who wants to pause activity during day/night or anyone who wants 0KB transfer limit for scheduler. Just don't expect it to grow into another #9203

I guess this would close following:

Closes #18451.

Screenshot Zrzut ekranu 2026-06-04 134355

Comment thread src/app/application.cpp Fixed
@thalieht

thalieht commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

"Alternative rate limits" and "Pause session" are mutually exclusive (or they should be, logically, i didn't read the code)
so i would rename this groupbox as "Scheduler" and put these two in a combobox or radio buttons.

@piopodg

piopodg commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

Something like this?
image

@thalieht

thalieht commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Sure, but "Use" is superfluous, it's a checkbox. Also looking at other comboboxes, only the first word is capitalized.

@piopodg

piopodg commented Jun 7, 2026

Copy link
Copy Markdown
Contributor Author

Ok, I changed it to combo box, but there are other things, that I also reworked.
Initially, while there was only a check box, I assumed that there will be just 2 states - paused and resumed, so this setting was covered by session cached value. Now I added enum for description of session state in scheduled mode, signal has now this enum as input. I also store it in Preferences. Why? I don't know if it is possible, but maybe scheduler could also "set" session to other states, like "Stop all downloads", "Stop all uploads" (and restore them later. I have not think about implementation, just an idea). Also, workaround mentioned in initial comment was removed, since session state is applied by scheduler on timeout event, and value is taken from Preferences.
If all this looks like "too much", then I can revert back to using boolean session cached value.

What I tested:

  1. Setting sync between gui and webui.
  2. Set scheduler, choosing "paused" state and check if applied according to scheduled hours
  3. While qbt in "paused" state and in scheduled hours, user decides not to pause session, but to use limits only. Transfers resume but limited.

Limits values are not changed by logic, when user decides to pause state in scheduled time. I find it breaking a setting, which I wanted initially. I think this would be not good, when I set limits, choose "pause", and limits were set to 0 automatically and I would have to change them again.

Leaving PR as draft for now. Maybe there would be other suggestions or fixes.

@piopodg
piopodg force-pushed the pause_session branch 2 times, most recently from 03e0252 to 5916db3 Compare June 14, 2026 08:19
@piopodg
piopodg force-pushed the pause_session branch 3 times, most recently from 75543fd to 6ab5f73 Compare July 10, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable Alternative Rate Limit of 0 KiBs

3 participants