355 Commits

Author SHA1 Message Date
Charles Kerr
71ad42b1ef refactor: make err arg optional in tr_sys_* funcs (#2827) 2022-03-27 12:37:29 -05:00
Charles Kerr
b8c3778cf4 fix: sonarcloud warnings (#2804)
* fix: break will never be executed

* refactor: compile the name fallback string

* fix: replace redundant type with auto

* fix: use init-statement to reduce variable scope

* fix: implicit conversion loses precision

* fix: use in-class initializer

* fix: make variable a pointer-to-const

* fix: local variable name shadows class variable

* fix: implicit conversion may lose precision
2022-03-24 00:18:41 -05:00
SweetPPro
791f59e8ba fix for editing magnet link tracker list (#2793)
Co-authored-by: SweetPPro <sweetppro@users.noreply.github.com>
2022-03-23 10:18:06 -05:00
SweetPPro
6e1b89d9a7 fixes "no data found..." error on restart for paused torrents (#2797)
Co-authored-by: SweetPPro <sweetppro@users.noreply.github.com>
2022-03-21 16:15:53 -05:00
Charles Kerr
03ee0028d4 refactor: tr_sys_path_dirname returns a std::string (#2792) 2022-03-21 15:22:50 -05:00
Charles Kerr
44e30bf092 perf: avoid excess filesystem checks (#2786) 2022-03-18 16:31:25 -05:00
Charles Kerr
22499c677a refactor: aggregate bandwidth objects (#2783) 2022-03-18 11:34:29 -05:00
Matan Ziv-Av
c07bac4e19 Limit bandwidth used by a group of torrents (#2761)
* Add support for bandwidth groups. i.e. Bandwidth limit for a (user specified) group of torrents,
2022-03-18 08:11:59 -05:00
Charles Kerr
5df252d1e1 fix: calculate ratio as uploaded / sizeWhenDone (#2770) 2022-03-17 13:41:48 -05:00
Charles Kerr
54ef7341a2 refactor: fmt pt 4 (#2774)
Co-authored-by: Mike Gelfand <mikedld@mikedld.com>
2022-03-16 19:23:44 -05:00
Charles Kerr
0be920156b refactor: fmt part 3 (#2773) 2022-03-15 19:51:36 -05:00
Charles Kerr
72a67054ea refactor: fmt part 2 (#2771) 2022-03-15 09:52:16 -05:00
Charles Kerr
af339a15ed refactor: remove deep logging (#2749)
* refactor: remove "deep logging"
2022-03-09 23:51:14 -06:00
Charles Kerr
0ac8c6079a refactor: remove redundant MAX_BLOCK_SIZE constant (#2740) 2022-03-04 23:35:22 -08:00
Charles Kerr
cdd819772d feat: tr_runInEventThread() now takes std::function, typesafe args (#2739) 2022-03-04 20:26:03 -08:00
Charles Kerr
0cd3eb26ff fix: webseed assertion failures (#2735) 2022-03-04 12:00:42 -08:00
Charles Kerr
60ef1abadf refactor: tr_torrents (#2722)
* refactor: add tr_torrents container
2022-03-01 15:06:29 -08:00
SweetPPro
943b57979f support for resuming magnet links (#2702)
* support for resuming magnet links

magnet links are now saved as a text file the `Torrents` folder as `.magnet` files.
2022-02-24 15:52:29 -06:00
Charles Kerr
7238724318 refactor: webseed (#2689)
* refactor: reduce nested conditional webseed logic

* refactor: use tr_block_info::Location in webseed

* request larger chunks at a time from webseeds

* fix: CURLOPT_MAXREDIRS to safeguard against loops

Discussion at https://trac.transmissionbt.com/ticket/6110 .
Reported by @x190 and @cfpp2p a few years back.
2022-02-23 07:38:18 -06:00
Charles Kerr
81441706c1 fixup! fix: bitfield assertion failure on zero-byte file
chore: code style
2022-02-21 14:39:00 -06:00
Charles Kerr
4bf613804c fix: bitfield assertion failure on zero-byte file
Fixes #2667.
2022-02-21 14:20:35 -06:00
Charles Kerr
f88f3c4b03 Feat: add tr_block_info::Location (#2649) 2022-02-18 17:17:19 -06:00
Charles Kerr
02b6cc76d1 feat: add tr_torrentSetTrackerList(), tr_torrentGetTrackerList() (#2642)
Add a getter/setter for torrent announce URLs as text that can be copied
and pasted: one URL per line, with a blank line between tiers.

C API: tr_torrentGetTrackerList() and tr_torrentSetTrackerList()
RPC APi: `trackerList` in `torrent-get` and `torrent-set`.

This deprecates `trackerAdd`, `trackerRemove`, and `trackerEdit`
from the RPC API.
2022-02-18 11:52:01 -06:00
Charles Kerr
3042ae5b76 fix: set torrent.doneDate when adding a new seed (#2634) 2022-02-16 17:04:06 -06:00
Charles Kerr
f87d737e0f feat: newly-added seeds skip the full verify step (#2626)
* feat: newly-added seeds skip the full verify step

This has been a much-requested feature but has also been contentious
because I want to ensure that Transmission never transmits unverified
data. See the GH pull request for context on how this works.
2022-02-14 13:17:51 -06:00
Charles Kerr
9f9b6cdaa2 feat: run script when done seeding (#2621)
* feat: add seeding-done script to core and rpc

* feat: add seeding-done script to gtk client

* feat: add seeding-done script to qt client

* feat: add seeding-done script to transmission-remote

* refactor: make Qt and GTK client text match

* test: update tests

Co-authored-by: Timothy Nibeaudeau <timothy.nibeaudeau@gmail.com>
2022-02-13 22:07:12 -06:00
Charles Kerr
31cbb3b708 feat: expose downloaded byte count to done script (#2619)
Fixes #1082. The use case is a torrent-done script that needs to know
if a torrent is done because it finished downloading or if it's done
because it's a newly-added seed.
2022-02-13 11:04:34 -06:00
Charles Kerr
7bdb6f777b refactor: remove callback from tr_torrentVerify() public API (#2592) 2022-02-09 12:02:59 -06:00
Charles Kerr
318d60b72d refactor: fix sonarcloud "use enum class" code smells (#2590)
* refactor: prefer constexpr over enum for GUI_PAD values

* refactor: prefer constexpr over enum for PrefsDialog values

* refactor: prefer constexpr over enum for StatsDialog values

* refactor: use enum class for GtrUnicode types

* refactor: prefer constexpr over enum for BT peer msg codes

* refactor: use enum class for TrMakemetaResult

* refactor: prefer constexpr over enum for BT metadata message types

* refactor: use enum class for AwaitingBt

* refactor: use enum class for EncryptionPreference

* refactor: use enum class for TrFormat in rpcimpl

* refactor: prefer constexpr over enum for QApp intervals

* refactor: prefer constexpr over enum for tr_resume bitfields

* refactor: prefer constexpr over enum for Qt/TrFileModel bitfields

* refactor: remove obsolete TODO comment in announce-list
2022-02-08 20:25:19 -06:00
Charles Kerr
ba14ffa74c refactor: sonarcloud "use if init" statements (#2587) 2022-02-07 23:44:31 -06:00
Charles Kerr
ebb2ab6aee chore: update license spdx abbreviations (#2582)
Use SPDX license list 3.0 terminology: replace deprecated identifiers
GPL-2.0" and "GPL-3.0" with "GPL-3.0-only" and "GPL-3.0-only".
2022-02-07 10:25:02 -06:00
Charles Kerr
ecef0feb0c refactor: clang-tidy in libtransmission (#2578)
* chore: enable cppcoreguidelines-slicing warning

* chore: enable readability-named-parameter warning

* chore: enable bugprone-reserved-identifier check

* chore: enable bugprone-not-null-terminated-result check

* chore: enable bugprone-sizeof-expression check

* chore: enable bugprone-incorrect-roundings check

* chore: enable misc-misplaced-const check

* chore: enable bugprone-suspicious-include check

* chore: enable bugprone-signed-char-misuse check

* chore: enable modernize-raw-string-literal check

* chore: enable readability-static-accessed-through-instance check

* chore: enable readability-implicit-bool-conversion check

* fixup! Merge branch 'main' into refactor/clang-tidy
2022-02-06 22:28:36 -06:00
LaserEyess
5565255d85 add labels to torrent-add rpc method (#2539)
This commit adds labels to the torrent-add method, allowing RPC users to
specify labels when adding a torrent. Labels metadata is commonly known
when adding torrents, so this removes the need to send another
torrent-set call to add labels.

Additionally, transmission-remote is updated to handle labels in
torrent-add.

Co-authored-by: LaserEyess <LaserEyess@users.noreply.github.com>
2022-02-03 00:02:30 -06:00
Charles Kerr
878405f862 Revert "fix: sonarcloud (#2558)" (#2562)
This reverts commit 8b9483f7fb.
2022-02-01 11:30:51 -06:00
Charles Kerr
8b9483f7fb fix: sonarcloud (#2558)
* fix: add const modifier for functions

* fix: many sonarcloud use-init-statement warnings
2022-01-31 22:46:27 -06:00
Charles Kerr
87dfabb9d2 refactor: replace tr_thread with std::thread (#2548) 2022-01-31 13:34:04 -06:00
Charles Kerr
ac823f3cc4 fix: sonarcloud warnings in new code (#2500) 2022-01-24 19:05:24 -06:00
Charles Kerr
e83a57efa3 refactor: re-enable some clang-tidy rules (#2498) 2022-01-24 13:07:55 -06:00
Charles Kerr
b45c831bcb refactor: use C++ objects in announcer (#2474) 2022-01-22 23:41:01 -06:00
Charles Kerr
4833723651 fixup! fix: don't follow symlinks when removing junk files (#1638) (#1638) (#2470)
code style
2022-01-21 12:39:01 -06:00
Vincent Vinel
ddca909699 fix: don't follow symlinks when removing junk files (#1638) (#1638)
This prevents accidentally following a symlink that points outside of
the torrent's folder and crawling the rest of the drive for junk files
to remove.

This also prevents symlinks that point to a folder from being treated as
real directories, which would cause them to be removed even if the folder
they point to is not actually empty.
2022-01-21 11:53:00 -06:00
Charles Kerr
df1cca9b57 chore: update copyright years, make notices consistent (#2463) 2022-01-20 12:27:56 -06:00
Charles Kerr
8d75736ad1 fix: empty torrent filename (#2435)
fix torrents readded due to unremoved cfg files.
2022-01-17 23:14:00 -06:00
Charles Kerr
aa2183c9c5 fix: torrents readded due to unremoved cfg files (#2433)
Fixes #2430.

When removing a torrent, try to remove config filenames under both old
and new filename formats. This prevents torrents from being incorrectly
re-added when old-format files aren't removed.
2022-01-17 20:36:41 -06:00
Charles Kerr
bcf5e4636a fix: calculate seed ratio by torrent size. (#2424)
Previously was calculated by number of bytes downloaded, which caused
edge cases when those two numbers were not the same, e.g. if the user
already had part of the torrent from another source and only downloaded
a small part. When this happened, the ratio could be very large and use
of seedratio would behave in a way that most people would not expect.

Note, the old behavior has been around for a VERY LONG TIME. Even though
this is a bugfix, it does change semantics. I don't think there is any
third-party code that depends on the old behavior but this is arguably
a breaking change.
2022-01-17 17:16:37 -06:00
Charles Kerr
3036a76beb fix: sonarcloud code smells (#2421) 2022-01-17 12:39:50 -06:00
Charles Kerr
db23ca4c6b refactor: replace tr_info with tr_torrent_metainfo (#2397)
* refactor: replace tr_info with tr_torrent_metafo
2022-01-15 13:33:57 -06:00
Charles Kerr
b0ee4007ff refactor: include cleanups (#2392)
* refactor: include <memory> when using shared_ptr or unique_ptr

* refactor: include <cstdio> iff we use it

* refactor: include <cstring> iff we use it

* refactor: include <cstdlib> iff we use it

* refactor: include <string_view> or <string> iff we use it

* refactor: include <array> iff we use it

* refactor: include <ctime> iff we use it

* refactor: include <cctype> iff we use it

* refactor: misc #include cleanups in libtransmission
2022-01-12 20:13:58 -06:00
Charles Kerr
a9284c0a6b fix: magnet link regression (#2390) 2022-01-11 08:28:14 -06:00
Charles Kerr
dfc06fe918 refactor: use std::vector in tr_info (#2386) 2022-01-09 10:55:09 -06:00