Commit Graph

1339 Commits

Author SHA1 Message Date
Vladimir Golovnev
93470f2080 Use subcategories unconditionally
PR #23585.
2025-12-16 21:56:15 +03:00
Vladimir Golovnev
c45dfb6662 Implement separate (advanced) "Tracker status" filter
PR #23452.
2025-12-03 10:09:35 +03:00
Hanabishi
4a3922d152 Make the active torrents filter reflect actual transfers
PR #23431.
Closes #23121.
2025-11-24 09:03:20 +03:00
Vladimir Golovnev
fb71c814ca Don't change the processing order of alerts of different types
PR #23373.
Closes #23319.
2025-10-14 13:00:48 +03:00
Chocobo1
34ad55bb29 Avoid duplicate lookup
In C++20 `std::views::transform()` followed by `std::views::filter()` has a nasty effect of
invoking transformation function twice.
Note that there will be a `std::views::cache_latest()` in C++26 to
address this issue.

Ref:
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2760r1.html#cache_last
https://stackoverflow.com/questions/64199664/why-c-ranges-transform-filter-calls-transform-twice-for-values-that-match

PR #23343.
2025-10-07 02:12:27 +08:00
Chocobo1
d5d690cace Utilize algorithms from std::ranges
The result is shorter code and improves readability.
Note that `asConst()` is still required for non-const containers, otherwise the container will
detach.

PR #23342.
2025-10-07 01:56:08 +08:00
Chocobo1
eed0e56d1a Use proper return type
`count()`, `length()`, `size()`, `indexOf()` and `lastIndexOf()` were
returning `int` in Qt5. In Qt6 they return `qsizetype`.

PR #23317.
2025-09-29 03:08:02 +08:00
Vladimir Golovnev
84224c1bbf Don't fail because of existing files when exporting torrent files
PR #23315.
Closes #23017.
2025-09-28 21:08:00 +03:00
Thomas (Tom) Piccirello
4ad93bafb2 Update Piccirello's copyright email
PR #23197.
2025-09-07 16:10:07 +08:00
Userdocs
3146a3c2f9 Fix compilation in C++23 mode
This adds c++23 support. In my testing it works for nox and desktop.

PR #23193.
2025-09-07 15:49:50 +08:00
Vladimir Golovnev
2631692cff Improve changing torrents queue positions
PR #23068.
2025-08-10 18:37:19 +03:00
Vladimir Golovnev
de7d9c960d Forbid usage of context-less connections
PR #23032.
2025-08-06 16:28:31 +03:00
HamletDuFromage
d7b330c069 WebAPI: Add setComment endpoint
No UI implementation as of now.

Closes #19598.
PR #23031.
2025-08-04 17:52:54 +08:00
Thomas Piccirello
2ebe8595c9 Modify CategoryOptions serialization to JSON
When a category's download path option is set to "Default", its `downloadPath` is serialized into JSON as `undefined`. This results in the `downloadPath` field being omitted from `torrents/categories` and `torrents/maindata` payloads (as is expected with an `undefined` value).

The use of `undefined` here causes an issue in the WebUI. Specifically, when the category previously contained a value for this field (i.e. download path option set to either "Yes" or "No"), the `processMap` logic in `SyncController` does not detect the removal this field. This results in the category's new `downloadPath` not being properly sent to the client. By switching from `undefined` to `null`, we ensure that the `downloadPath` value is always included in the category's payload. This allows `processMap` to properly detect whenever the value changes.

This change is backwards compatible with existing categories.json files. Older qBittorrent versions should also be able to parse new categories.json files containing `null`.

More context: cd3fbfbf9b (r2173148696)

PR #22958.
2025-07-07 00:17:57 +08:00
Vladimir Golovnev
71af105a89 Avoid copying resume data when loading torrents
PR #22899.
2025-06-23 12:20:01 +03:00
Vladimir Golovnev
794310dca9 Add WebAPI for fetching torrent metadata
PR #21015.
2025-06-17 10:15:21 +03:00
Leon Blakey
d7a5430893 Improve resume queue load performance
PR #22831.

---------

Co-authored-by: Vladimir Golovnev <glassez@yandex.ru>
2025-06-13 09:47:23 +03:00
Thomas Piccirello
69bf31f4e9 Add WebAPI for downloading torrent metadata
Signed-off-by: Thomas Piccirello <thomas@piccirello.com>
2025-06-11 17:03:46 -07:00
Vladimir Golovnev
05bcc4e175 Don't limit the size of read "resume data"
PR #22825.
2025-06-07 06:58:48 +03:00
Vladimir Golovnev
526abdf7ce Avoid data copying when prepare resume data
PR #22812.
2025-06-06 08:59:39 +03:00
Vladimir Golovnev
2cbfb91b88 Use modern API to export torrent
PR #22786.
2025-06-03 15:24:52 +03:00
Vladimir Golovnev
0729c9a2f8 Handle libtorrent alerts in SessionImpl only
PR #22798.
2025-06-03 08:18:12 +03:00
Vladimir Golovnev
a9213627a9 Interpret tracker "updating" status as a separate property
PR #22787.
2025-05-30 08:34:26 +03:00
Vladimir Golovnev
8cd1a80852 WebAPI: Add more properties to 'torrents/info' result
PR #22753.
2025-05-27 09:37:06 +03:00
Chocobo1
09071d2b69 Allow symbolic links in torrent creator on Windows
Note that .lnk files (shortcuts) are always ignored on Windows.

Closes #22665.
PR #22675.
2025-05-14 07:13:52 +08:00
Vladimir Golovnev
d29f47c36e Revamp adding torrents to libtorrent session
PR #22648.
2025-05-08 16:31:02 +03:00
Vladimir Golovnev (Glassez)
ab04064adc Store AddTorrentParams inside alert handlers 2025-05-07 06:52:33 +03:00
Vladimir Golovnev (Glassez)
9afbd47b52 Assign add_torrent_alert handler when adding torrent 2025-05-07 06:52:33 +03:00
Vladimir Golovnev (Glassez)
582dc99cae Don't access libtorrent session directly from TorrentImpl 2025-05-07 06:52:33 +03:00
Vladimir Golovnev (Glassez)
3691eb948e Join the similar code paths 2025-05-07 06:52:33 +03:00
Vladimir Golovnev (Glassez)
76bb4e5f98 Add helpers to get InfoHash from libtorrent classes 2025-05-07 06:52:23 +03:00
Vladimir Golovnev
6cd6267c26 Fix ratio handling
PR #22638.
2025-05-01 14:18:18 +03:00
Vladimir Golovnev
e7dee969e1 Remove dubious seeding time max value
PR #22624.
2025-05-01 08:57:10 +03:00
Vladimir Golovnev
c2f2a38582 Call QPromise::start() early to avoid race condition
PR #22617.
2025-04-28 18:04:35 +03:00
Vladimir Golovnev
732b2bcbdb Provide asynchronous results via QFuture
Makes asynchronous logic to look more straightforward.
Allows caller to choose blocking or non-blocking way of obtaining asynchronous results via the same interface.

PR #22598.
2025-04-27 16:24:07 +03:00
Vladimir Golovnev
33aaa867b5 Drop support of Qt 6.5
PR #22599.
2025-04-27 16:21:20 +03:00
Kostiantyn Chernenok
fc5daf6e1d Clamp seeding time limit in session
Add clamping for seeding and inactive seeding time limit on setting from dialog and loading from config.

Closes #21953.
PR #22558.

Signed-off-by: Kostiantyn <kos.chernenok@gmail.com>
2025-04-20 16:34:04 +08:00
Vladimir Golovnev
2785636d3f Prevent crash due to corrupted resume data
PR #22569.
Closes #22540.
2025-04-17 11:16:17 +03:00
Vladimir Golovnev
15069b2643 Fix the torrent relocates files when switching to "manual" mode
PR #22564.
Closes #22283.
Closes #22546.
2025-04-16 10:23:34 +03:00
Chocobo1
ff03eeab5b Show info hash in log when added a duplicate torrent
Closes #22161.
PR #22505.
2025-04-08 16:31:04 +08:00
Vladimir Golovnev
4bd50672e8 Improve add torrent error handling
PR #22468.
2025-03-25 09:13:15 +03:00
Chocobo1
b28c229f85 Add control for 'hostname resolver cache expiry interval'
Also add a few missing units in WebUI.

Closes #22267.
PR #22439.
2025-03-17 19:40:06 +08:00
Chocobo1
5a4b3b25d3 Use slice method where applicable
These code segments already have its boundary checked and can thus be faster.

PR #22411.
2025-03-15 14:58:59 +08:00
Vladimir Golovnev
d174bc75e4 Show free disk space in status bar
PR #22407.
Closes #19607.
2025-03-13 14:47:10 +03:00
Chocobo1
8da43a4054 Use const accessor
This avoids an unnecessary check to the container internal atomic variable and prevents
potential detachment.

PR #22280.
2025-02-16 15:51:40 +08:00
Maxime Thiebaut
4406a3f173 Add announce_port support
The `announce_port` setting permits to overwrite the port passed along to trackers as the `&port=` parameter. If left as the default, the listening port is used. This setting is only meant for very special cases where a seed's listening port differs from the effectively exposed port (e.g., through external NAT-PMP). See https://github.com/arvidn/libtorrent/pull/7771 for an example use-case.

This PR adds the relevant setting alongside the existing `announce_ip` setting.

PR #21692.
2025-02-08 16:12:50 +08:00
Vladimir Golovnev
86387fbe49 Return first tracker as fallback for "current tracker"
PR #22224.
Closes #20415.
2025-02-01 14:58:12 +03:00
Chocobo1
82d90e599c Preserve allocated buffer capacity
PR #22138.
2025-01-12 21:01:39 +08:00
Hanabishi
68ecb13d14 Change URL seed error message
Current URL seed error message assumes that only possible error is DNS lookup failure, which is not true.
So replace it with a more generic message. Real reason is provided by the 'Error:' part.

PR #22119.
2025-01-10 08:31:28 +03:00
Thomas Piccirello
4fc36b9e99 Support fetching tracker list from URL
Trackers specified at the URL will be added to newly added public torrents.

This feature is adapted from qBittorrent-Enhanced-Edition to allow for automatically adding trackers retrieved from a URL. @ngosang's trackerlist repo is a good example, however I've opted not to include a default URL.

Partially addresses #14535.
PR #21828.
2025-01-08 14:51:09 +08:00