Add a module to convert between tr4 and tr5 RPC / settings / config file payloads.
This will be used as a compatibility layer between Transmission 5's naming scheme
and Transmission <= 4.
Co-authored-by: Yat Ho <lagoho7@gmail.com>
Co-authored-by: Dzmitry Neviadomski <nevack.d@gmail.com>
* refactor: add quarks for the RPC method names
* update tr_quark_convert() to handle RPC method names
* refactor: use interned keys for RPC method names
* test: add torrentGetLegacy test
* refactor: use interned keys for RPC method names in tr-qt
* refactor: use interned keys for RPC method names in tr-remote
* refactor: use interned keys for RPC method names in tests
* refactor: use interned keys for RPC method names in tr-gtk
* chore: fix readability-identifier-naming regression
* chore: remove two unused quarks
looks like these were never used?
* chore: remove unused quark TR_KEY_have
unused since May 2024 3677e7a5
* chore: remove unused quark TR_KEY_date
unused since Oct 2021 9200d972
* fix: remove unused codepath
* feat: store `preferred_transports` as array in `settings.json`
* refactor: `Settings::save()` returns `tr_variant::Map`
* feat: new RPC API for `preferred_transports`
* feat: new arg `--preferred-transports` for remote
* feat: allow downloading sequentially from a specific piece
* Apply review changes
Co-authored-by: Yat Ho <lagoho7@gmail.com>
* Use sequential_download_from_piece param in torrent-add, and save it to resume file
* fix: change observable type bool -> tr_piece_index_t
* fix: run code_style.sh
* fix: improved test and missing comment
Co-authored-by: Yat Ho <lagoho7@gmail.com>
* fix: apply similar changes to sequentialDownloadFromPiece test
* docs: change parameter type boolean -> number
---------
Co-authored-by: Yat Ho <lagoho7@gmail.com>
* refactor: rename torrent-complete-verify-enabled to snake_case
* docs: add docs for torrent_complete_verify_enabled
* code review: correct docs data type
* chore: remove unused TR_KEY_comment_utf_8
chore: remove unused TR_KEY_created_by_utf_8
chore: remove unused TR_KEY_name_utf_8
chore: remove unused TR_KEY_path_utf_8
These keys have been unused since fe288b45 (#2542)
* chore: remove unused TR_KEY_ut_comment
chore: remove unused TR_KEY_ut_recommend
Never used. We can add these back when we support them
* remove unused TR_KEY_queue_move_bottom
remove unused TR_KEY_queue_move_down
remove unused TR_KEY_queue_move_top
remove unused TR_KEY_queue_move_up
Added in c1559f3c, but never used.
* chore: remove unused TR_KEY_play_download_complete_sound
Never used and is a duplicate of TR_KEY_torrent_complete_sound_enabled.
Maybe it was a draft name that accidentally snuck into production?
* chore: remove unused TR_KEY_downloaders
chore: remove unused TR_KEY_min_announce_interval
Unused since 7f60738c (#2529)
* chore: remove unused TR_KEY_recent_download_dir_1
chore: remove unused TR_KEY_recent_download_dir_2
chore: remove unused TR_KEY_recent_download_dir_3
chore: remove unused TR_KEY_recent_download_dir_4
chore: remove unused TR_KEY_recent_relocate_dir_1
chore: remove unused TR_KEY_recent_relocate_dir_2
chore: remove unused TR_KEY_recent_relocate_dir_3
chore: remove unused TR_KEY_recent_relocate_dir_4
Looks like these were intended for the GTK client's recent dirs
feature (see gtr_save_recent_dir() and gtr_get_recent_dirs()),
but that code does it better without quarks.
* Add peer traffic data in torrent-get rpc interface
* style issue
* update peer rpc spec
* Add bytes_sent_to_peer and bytes_sent_to_client in peer_info and peer-mgr
* make counting variables non-persistent and limited to last several seconds
* change variable to snake-case
* use size_t instead of uint16_t for bytes
* fix use camel_case
* move to did_write
* add raw PeerID to rpc interface
* use snake_case
* add peer_id to doc
* pass peer_id only and use peer_id_t and base64 encoding when passing peer_id to stat
* clang format
* fix dangling pointer
* remove std::optional
* clean up tr_peerMsgs constructor
* move b64encode to rpc
* just use constructor
* Update libtransmission/peer-msgs.cc
Co-authored-by: Yat Ho <lagoho7@gmail.com>
---------
Co-authored-by: Yat Ho <lagoho7@gmail.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* build: clang-tidy headers when building libtransmission
* chore: revert `= default` workaround
It was introduced in 6909ec0bad to fix build issues with macOS 10.14. We
no longer support that version.
* fix: clang-tidy warnings for libtransmission
* build: clang-tidy headers when building tests
* fix: clang-tidy warnings for tests
* build: clang-tidy headers when building qt
* code review: don't manually edit mime-types.h
* code review: unify variable naming for static private members
* feature: proxy support for web-connections
* forgotten changes
* fix code-styles
* Documentation for new setting "proxy-url"
* Create property proxyUrl for class tr_web. Lazy creation of tr_web object in tr_session after loaded settings from file
* Update docs/Editing-Configuration-Files.md
Simplify the documentation text
Co-authored-by: ThinkChaos <ThinkChaos@users.noreply.github.com>
* Fix merge error
* Fix merge error.
* Simplify tr_web's lifecycle. Fix error. Rename quark to sneak_case-style
* Fix parameter value test
---------
Co-authored-by: ThinkChaos <ThinkChaos@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* Revert "feat: save queue order between sessions (#6753)"
This reverts commit 4db50dae10.
* refactor: new torrent queue class
* refactor: replace queue code with new class
* test: new tests for new class
* feat: store and load queue order across sessions
* build: xcode
* refactor: use set_difference instead of unordered_set
* code review: use `tr_torrent_id_t` as key
* fix: don't overflow when moving up/down
---------
Co-authored-by: Dzmitry Neviadomski <nevack.d@gmail.com>
* refactor: add `tr_pex::to/from_variant()`
* refactor: store peers as benc in resume
* fix: discard invalid pex in `tr_pex::from_variant()`
* fix: limit number of peers loaded from resume
* feat: add `ipProtocol` argument to `port-test` rpc method
* chore: update rpc-spec.md
* feat: split port check UI to IPv4 and IPv6 in webUI
* fix: default `open` to false if cannot get response
* chore: minor docs wording tweak
* chore: make clang-tidy happy
* chore: RPC doc tweaks
* fix: bad merge
* chore: review feedback
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* chore: match quark enum with parameter case
* refactor: use descriptive strings for `ipProtocol`
* chore: update docs
* fixup! refactor: use descriptive strings for `ipProtocol`
* fixup! chore: update docs
---------
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* Expose files' begin and end pieces via RPC
This adds two arguments, `beginPiece` and `endPiece`, for each of the entries
in the `files` array of the RPC's `torrent-`get` method.
The point is to allow RPC clients to display a file's completion progress as
piece-based in addition to byte-based.
* fix(gtk): prevent duplicate shortcut folders
This prevents duplicates if the recent destination is also a system
shortcut folder.
* refactor(gtk): create gtr_get_recent_dirs helper
* feat(gtk): remember 4 recent relocate dirs
* Support binding the RPC to a Unix socket on *nix
This commit adds unix socket support for a RPC. Some refactoring was
required in order to split out the RPC server's address struct from the
normal network address struct used for peers. It would cause
unacceptable overhead to add the unix socket length to the union.
Co-authored-by: Malte Voos <malte@malvo.org>
* add RPC socket mode to control unix socket perms
Unix socket permissions are important to control for security reasons,
and libevent defaults to 0755, which may not be what users want.
Co-authored-by: LaserEyess <LaserEyess@users.noreply.github.com>
Co-authored-by: Malte Voos <malte@malvo.org>