Skip to content

Add alternative connection limits option for seeding torrents#23065

Open
lstrsrt wants to merge 22 commits intoqbittorrent:masterfrom
lstrsrt:seeding-connection-limits
Open

Add alternative connection limits option for seeding torrents#23065
lstrsrt wants to merge 22 commits intoqbittorrent:masterfrom
lstrsrt:seeding-connection-limits

Conversation

@lstrsrt
Copy link

@lstrsrt lstrsrt commented Aug 5, 2025

This PR adds a new option to the Connection settings: a checkbox + spinbox "Maximum number of connections per seeding torrent" which allows the user to configure a different connection limit for seeding torrents. The rationale for this is laid out in #2193 -- basically it is not necessary to have as many connections when seeding a torrent vs when downloading it. I have not worked on this codebase before, let me know if there is a better way to achieve this.

image

Addresses #2193.

Edit: Updated screenshot.

@glassez
Copy link
Member

glassez commented Aug 5, 2025

What immediately caught my eye in the screenshot is the confusing option "Alternative limit for seeding torrent". It looks like it should be a sub-option of "Maximum number of connections per torrent". Otherwise, it should contain the same text, e.g. "Maximum number of connections per seeding torrent".

@lstrsrt
Copy link
Author

lstrsrt commented Aug 5, 2025

The option naming was inspired from the screenshot in the linked issue. It is meant to imply that it is a suboption of the option above it (the screenshot doesn't show it, but the checkbox can only be toggled when "Maximum number of connections per torrent" is enabled).

I'm thinking it may be better to just make it a separate option though, so that users can set a limit only for seeding torrents.

Edit: Also starting to think that the "AltConnections" naming in the code is unclear. "SeedConnections" would be clearer. Will update this later.

@glassez
Copy link
Member

glassez commented Aug 6, 2025

It is meant to imply that it is a suboption of the option above it (the screenshot doesn't show it, but the checkbox can only be toggled when "Maximum number of connections per torrent" is enabled).

Usually suboptions in qBittorrent look like the following:
000

@glassez
Copy link
Member

glassez commented Aug 6, 2025

I'm thinking it may be better to just make it a separate option though, so that users can set a limit only for seeding torrents.

I agree.

the "AltConnections" naming in the code is unclear.

👍

@glassez
Copy link
Member

glassez commented Aug 6, 2025

"SeedConnections" would be clearer.

👎
It's a torrent who is seed.
So it should be "MaxConnectionsPerSeedingTorrent".
"MaxConnectionsPerTorrent" should become "MaxConnectionsPerDownloadingTorrent" to be consistent.

@lstrsrt

This comment was marked as resolved.

@glassez

This comment was marked as resolved.

@lstrsrt
Copy link
Author

lstrsrt commented Aug 6, 2025

Ok, renaming done. Hopefully didn't miss anything (I tried to automate it with sed as best as I could).

Also I guess this requires a DB upgrade due to changing an existing option name... see newest commit.

Edit: Or alternatively this commit could be dropped and the DB name kept as-is. But then it would be inconsistent with the names in the code.

@github-actions
Copy link

This PR is stale because it has been 60 days with no activity. This PR will be automatically closed within 7 days if there is no further activity.

@github-actions github-actions bot added the Stale label Oct 29, 2025
@lstrsrt
Copy link
Author

lstrsrt commented Oct 29, 2025

Bump. As far as I can tell, the failed checks are unrelated to the code added here.

@github-actions github-actions bot removed the Stale label Oct 30, 2025
@xavier2k6
Copy link
Member

@qbittorrent/bug-handlers Does no one have anything to say about it?

I've no issue with it except for the "add to torrent option" part of #2193 (comment) wasn't addressed.

If it's done in another PR, then that'll be ok too.

No real blockers otherwise.

xavier2k6
xavier2k6 previously approved these changes Jan 4, 2026
@github-actions github-actions bot removed the Stale label Jan 5, 2026
xavier2k6
xavier2k6 previously approved these changes Jan 7, 2026
stalkerok
stalkerok previously approved these changes Jan 7, 2026
@stalkerok
Copy link
Contributor

stalkerok commented Jan 7, 2026

There is another related request for a feature that would also be in demand

This would be useful for me for different storage devices. Most often, these limits are only needed for individual torrents.

I would even say that this PR does not solve #2193
It also says: connections per torrent (see the last screenshot)

@lstrsrt
Copy link
Author

lstrsrt commented Jan 8, 2026

I would even say that this PR does not solve #2193 It also says: connections per torrent (see the last screenshot)

I was meaning to add this in another PR once this one has been merged. But I'll change the PR description to "address" instead of "resolve".

thalieht
thalieht previously approved these changes Jan 10, 2026
@lstrsrt lstrsrt dismissed stale reviews from thalieht, stalkerok, and xavier2k6 via 78a53c2 January 10, 2026 16:57
Copy link
Member

@Chocobo1 Chocobo1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last comment from me.

@stalkerok
Copy link
Contributor

@lstrsrt, resolve merge conflicts.

@lstrsrt
Copy link
Author

lstrsrt commented Jan 22, 2026

@stalkerok
Done

@xavier2k6 xavier2k6 requested a review from a team January 22, 2026 22:50
@xavier2k6 xavier2k6 added this to the 5.2 milestone Jan 22, 2026
@thalieht
Copy link
Contributor

Probably not important but i'll say it:
When starting a seeding torrent with the settings like this:

  • Maximum number of connections per downloading torrent
  • Maximum number of connections per seeding torrent

On first refresh in the peer list, the amount of peers appearing is equal to whatever is set in Maximum number of connections per downloading torrent. Then more peers show up in the next refresh. This doesn't happen on a downloading torrent when these settings are reversed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants