Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to pause all torrents when quitting qBT #18993

Closed
ushuc opened this issue May 18, 2023 · 24 comments · Fixed by #20757
Closed

Option to pause all torrents when quitting qBT #18993

ushuc opened this issue May 18, 2023 · 24 comments · Fixed by #20757
Assignees

Comments

@ushuc
Copy link

ushuc commented May 18, 2023

Suggestion

There should be an option in the qBT settings to make qBT pause all torrents when quitting the application. The result is that when the user starts qBT again, then all torrents are paused and not (unintentionally) downloading.

Use case

With this setting available, it would be possible for users to start qBT without worrying that something might start unintentionally downloading only by opening qBT. Because users are sometimes in a place where torrents (or peer to peer downloads/applications in general) are not allowed. This way users could open/use qBT without the risk to unintentionally causing P2P traffic on the network (and risk of getting banned from the network).
Basically, my idea is a safety option.

Extra info/examples/attachments

No response

@lilws
Copy link

lilws commented May 24, 2023

I love that option too, but also implement after start qbittorrent, it will automatically start all torrents again. My client running over 400 torrents, I found that if I restart it will take times to quit. But pause all torrents then quit it must faster.

@minksW
Copy link

minksW commented May 24, 2023

W feature

@Vagmer
Copy link

Vagmer commented May 25, 2023

ushuc wrote:

There should be an option in the qBT settings to make qBT pause all torrents when quitting the application. The result is that when the user starts qBT again, then all torrents are paused and not (unintentionally) downloading.

That would be better to do on startup instead (handles cases of qBT / PC crashing or qBT being forcibly closed), but adding this functionality as a more proper feature will not involve altering the pause state of all torrents, but by instead adding a global 'activity' switch that allows to toggle off the application making any connections (and kills any active connections if there any when the switch is toggled from on to off), essentially allowing to pause/suspend the application's internet activity (including program update checks, probably) at will, and then adding a setting to choose if this switch starts out in on or off state on program startup. That would allow far more user control (flexibility) than allowed right now or by the original suggestion. A less convenient and accessible workaround to currently do this is to use a software firewall to block qBT internet access when you want to do this.

lilws wrote:

I love that option too, but also implement after start qbittorrent, it will automatically start all torrents again. My client running over 400 torrents, I found that if I restart it will take times to quit. But pause all torrents then quit it must faster.

Doing that would beat the purpose of what the OP wants to do, which is make qBT not initiate transfers on startup.
qBT taking a long or very long time to quit is a known issue, it happens due to libtorrent waiting to finish announcing stop to the tracker on program shutdown for every non-paused torrent, apparently faulty handling of certain 'bad' trackers by libtorrent, and qBT always waiting indefinitely for libtorrent on shutdown: #18697 #18772

@KBJ2007
Copy link

KBJ2007 commented Aug 10, 2023

I would also like to see a pause condition on client startup as well.

@ushuc
Copy link
Author

ushuc commented Aug 12, 2023

This feature request is about a pause condition at application SHUTDOWN.
A pause condition on client SHUTDOWN is better. Because on startup it can happen that the pause condition kicks in a couple of seconds late(r) and the torrents may already have caused traffic or have connected to the torrent network. Pause on exit would prevent this risk.

The problem about a STARTUP pause condition is this:

Doing that would beat the purpose of what the OP wants to do, which is make qBT not initiate transfers on startup.
qBT taking a long or very long time to quit is a known issue, it happens due to libtorrent waiting to finish announcing stop to the tracker on program shutdown for every non-paused torrent, apparently faulty handling of certain 'bad' trackers by libtorrent, and qBT always waiting indefinitely for libtorrent on shutdown: #18697 #18772

@LazyPajen
Copy link

Love this idea!
In settings: "Next start - Start in stopped mode"
My VPN tells me what port to use.
My case as today:

  1. Stop (Pause) all torrents.
  2. Quit BT
  3. Do what's to be done Sometimes VPN has to be stopped
  4. Reboot /Restart
  5. Wait for VPN to tell me what port to use
  6. Start QB and fill what port to use in settings
    Maybe a command line for QB to start in paused mode (I have not found that) as workaround
  7. Start (resume) all Torrents

@glassez
Copy link
Member

glassez commented Nov 12, 2023

In fact, it's not a good idea to stop all torrents (per-torrent), since many users keep some of their torrents stopped, so it would be extremely inconvenient for them to start only the torrents they need.
Fortunately, we have the ability to pause the entire BitTorrent Session, so that when it resumes, it will preserve the states of individual torrents. The only problem is how to clearly display a paused Session in the UI (at least for me, since I am not very friendly with designing "good" UI).

@glassez glassez changed the title [Feature idea] Option to pause all torrents when quitting qBT Option to pause all torrents when quitting qBT Nov 12, 2023
@LazyPajen
Copy link

LazyPajen commented Nov 12, 2023

I understand: Its a bit of syntax and I see your worries.
Honestly IMHO there are more syntax that i don't like
some examples
"Paused" are in my head Stopped
"Resumed" --- Started
We have today:
Pause ALL
Resume ALL
Could it be so "simple" that we call it and add
Pause ALL Network for torrents (pause the entire BitTorrent Session)
Resume ALL Network torrents (Resume the entire BitTorrent Session)
The Status of the individual torrent should not change (at least from user view)

Maybe there are more things to consider like WEB-GUI - search - other addons
I do not use those so really I don't know
Could it be so that are those "extra" functions disables "Pause/Resume all networks"
Probably there are more under the hood that I am not aware off

I love the idea that "pause/resume the entire BitTorrent Session" could be the way to go
If you go with this I would like to test it - before release to the wild

I would like to add something like this In settings: "Next start -Pause ALL Network"

@glassez
Copy link
Member

glassez commented Nov 13, 2023

The problem I mentioned above is not how to give the user the option to pause the Session, but how to display the fact that the Session is currently paused. Otherwise, someone pausing the Session and forgetting to resume it, will be at a loss why his torrents are not downloading, which will lead to a bunch of false positive error reports.

@glassez
Copy link
Member

glassez commented Nov 13, 2023

At least it could be some modified window/tray icons (e.g. "pause" symbol on top of regular icon).

@qbittorrent/bug-handlers
Do you guys have any ideas? (just please don't be too difficult)

@thalieht
Copy link
Contributor

I thought about this a lot in the past. That tray paused icon is of course required but tray can be disabled so it can't be just that. Best i came up with is some kind of big overlay transparent (to actions) e.g. a paused icon or some text in the middle of the transfer list or maybe a slow blinking icon in some place that is always visible i.e. not in status bar, filters widget etc but almost everything can be disabled... and changing window title is not enough IMO (personally i never look at it).

@glassez
Copy link
Member

glassez commented Nov 13, 2023

That tray paused icon is of course required but tray can be disabled so it can't be just that.

Not only tray icon, but window icon too (I mean the one displayed in taskbar).

@glassez
Copy link
Member

glassez commented Nov 13, 2023

That tray paused icon is of course required but tray can be disabled so it can't be just that.

Not only tray icon, but window icon too (I mean the one displayed in taskbar).

But I'm not sure that it can be dynamically changed by the app itself...

@xavier2k6
Copy link
Member

Display it in transfer list progress bar???

@glassez
Copy link
Member

glassez commented Nov 13, 2023

Best i came up with is some kind of big overlay transparent (to actions) e.g. a paused icon or some text in the middle of the transfer list

Hmm, I need to investigate this option. Or, if it doesn't work out, something simpler, like a big red text above the transfer list.

@LazyPajen
Copy link

I tried to think: What's most Common on the UI that I Cannot turn off:
Connection status: Have two levels of status with different icons: "No incoming" and "Online" ADD a third "Offline"
Beside is three (3) fields with speed related items "Alternate speed" and "upp" and "down" speeds
could these be simple enough to use .

a Q.
" pause the entire BitTorrent Session" does this include a stop command to the trackers? before going offline

I am very happy that you are considering this!

@Vagmer
Copy link

Vagmer commented Nov 13, 2023

Best i came up with is some kind of big overlay transparent (to actions) e.g. a paused icon or some text in the middle of the transfer list

Hmm, I need to investigate this option. Or, if it doesn't work out, something simpler, like a big red text above the transfer list.

Yeah, that will work, though I think you should have both. UI-wise, the text above the transfer list could be in a new rectangle that pops up with text on one line, similar to what browsers display when blocking a popup and as such. This text box (containing e.g. "qBittorrent network activity is suspended. No torrents will download or upload. Click here or go to 'File->Unsuspend network' to reinstate/renew network activity.") could also be dismissable in case the user has read it, is aware and annoyed by it, but it's a small can of worms and the primary purpose of the program is to have network activity, so could be better to just have it permanent (until network activity is reinstated).
A possible problem with a giant transparent paused icon overlaying the center of the transfer list is themes, meaning the transfer list background could be dark/light/back/white, so you need to guess or determine what default color for the paused icon will be visible or use one that hopefully will be most of the time, like blue or red - and let themes control and override this.

IMO if you truly want this feature to not have the potential to introduce confusion in users, false positive reports and cause you to need to ask the poster of every bug report whether his pause toggle is on, then all the measures discussed to indicate current network paused state (all in all most are individually fairly easy to miss) need to be implemented. It would probably also be better not to use the exact terms "pause" and "resume" in relation to this feature, and to use some synonyms instead.

Summary of indicators:
-Tray icon and taskbar icon overlayed with pause sign - pretty hard to see but still essential and good to have.
-Window title has " (Suspended)", " (Network suspended)" or similar appended to the end of it. Hovering the qBT tray icon will also say the same thing in its tooltip. Also doesn't stand out a lot on its own, but good to have.
-Transparent pause icon overlayed over the middle of the transfer list. Needs theme support. Possible alternative to this is a kind of partial "graying out" or changing the color of a large part of the UI.
-Text box above the transfer list/execution log area with explanation text. This is the only indicator that is completely clear as to what's going on and so is unambiguous and hard to confuse. The tray icon tooltip could maybe have the same or similar text, really, I guess there isn't really a size limit on it. The text box could be dismiss-able, but that might actually be a bad idea to offer that by default. The text in the text box will be slightly different if qBT has been started with automatically suspended network (rather than network activity being suspended mid-session by manual user action), to indicate this ("In accordance to settings, qBittorrent has been started with network activity suspended...", possibly instructing where to turn this off, to).
-Connection status can be shown as something different, like "Suspended".
-To avoid possible confusion with individual torrent states, don't use the words "Pause" and "Resume" in regards to this new feature.

Should be almost impossible to confuse or forget this, then (especially if the explanation text can't be dismissed).

@glassez
Copy link
Member

glassez commented Nov 13, 2023

@Vagmer
Sorry, I wasn't going to devote my whole life to its implementation. I prefer to limit myself to some minimum of required things.

@Vagmer
Copy link

Vagmer commented Nov 13, 2023

@glassez

Sorry, I wasn't going to devote my whole life to its implementation. I prefer to limit myself to some minimum of required things.

I figured it could look deceptively daunting, even though most of it is small basic stuff which would presumably take little time to implement. The changed icons are standard and basic, allow the state to be seen when the window is minimized/trayed, and they're where a savvy user would expect to see an indicator, though it can be expected that some users will miss them. You could stick with just that, but then, as you'd said, expect those false positive reports, and to continually have to ask reporters that haven't mentioned it to make sure whether they're paused. It's a shame, since then it might be better off in the long run to not implement this (certainly if valuing time), and I think it's a pretty important and elemental feature, I had wanted such a feature myself, as well.

@ushuc
Copy link
Author

ushuc commented Apr 22, 2024

Yeah, pause a session like suggested above would be great.

So this feature is going to never be implemented because one cannot decide on indicator symbol style?
Why not implement it so that at least users can make use of this function and then fine-tune it later.

@glassez
Copy link
Member

glassez commented Apr 23, 2024

Why not implement it so that at least users can make use of this function and then fine-tune it later.

OK, working on it...

@glassez
Copy link
Member

glassez commented Apr 25, 2024

Why not implement it so that at least users can make use of this function and then fine-tune it later.

OK, working on it...

#20757

@ushuc
Copy link
Author

ushuc commented Apr 29, 2024

Cool, can't wait to use it. THX!
Just one question: Pausing the session on qBT close was proposed to act as kind of a "safety feature" to make sure that absolutely no traffic is initiated when qBT starts up the next time. When the session is paused on qBT start, does this make sure, too, that no traffic is initiated? What if the session gets paused only after a short moment when some minor traffic has already happened? Can session pause on startup prevent that reliably? Maybe change the setting to "Set session to paused state on qBT close"?

@glassez
Copy link
Member

glassez commented May 1, 2024

Pausing the session on qBT close was proposed to act as kind of a "safety feature" to make sure that absolutely no traffic is initiated when qBT starts up the next time.

There was no question of "absolutely no traffic is initiated". It was just about "all torrents are paused and not (unintentionally) downloading".

When the session is paused on qBT start, does this make sure, too, that no traffic is initiated?

It is about "BitTorrent session" if it was unclear. So no BitTorrent related traffic should not be initiated.

What if the session gets paused only after a short moment when some minor traffic has already happened?

BitTorrent session is initialized "paused" and then it will either start processing or remain paused (if you have enabled appropriate option).

glassez added a commit that referenced this issue May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants