mirror of
https://github.com/transmission/transmission.git
synced 2025-12-12 20:35:49 +01:00
refactor: unify quarks and strings to snake_case (#7108)
* refactor: change `leftUntilDone` to `left_until_done` * refactor: change `magnetLink` to `magnet_link` * refactor: change `manualAnnounceTime` to `manual_announce_time` * refactor: change `maxConnectedPeers` to `max_connected_peers` * refactor: change `metadataPercentComplete` to `metadata_percent_complete` * refactor: change `peersConnected` to `peers_connected` * refactor: change `peersFrom` to `peers_from` * refactor: change `peersGettingFromUs` to `peers_getting_from_us` * refactor: change `peersSendingToUs` to `peers_sending_to_us` * refactor: change `percentComplete` to `percent_complete` * refactor: change `percentDone` to `percent_done` * refactor: change `pieceCount` to `piece_count` * refactor: use quark when possible * refactor: change `pieceSize` to `piece_size` * refactor: change `primary-mime-type` to `primary_mime_type` * refactor: change `rateDownload` to `rate_download` * refactor: change `rateUpload` to `rate_upload` * refactor: change `recheckProgress` to `recheck_progress` * refactor: change `secondsDownloading` to `seconds_downloading` * refactor: change `secondsSeeding` to `seconds_seeding` * refactor: change `sizeWhenDone` to `size_when_done` * refactor: change `startDate` to `start_date` * refactor: change `trackerStats` to `tracker_stats` * refactor: change `totalSize` to `total_size` * refactor: change `torrentFile` to `torrent_file` * refactor: change `uploadedEver` to `uploaded_ever` * refactor: change `uploadRatio` to `upload_ratio` * refactor: change `webseedsSendingToUs` to `webseeds_sending_to_us` * refactor: change `bytesCompleted` to `bytes_completed` * refactor: change `clientName` to `client_name` * refactor: change `clientIsChoked` to `client_is_choked` * refactor: change `clientIsInterested` to `client_is_interested` * refactor: change `flagStr` to `flag_str` * refactor: change `isDownloadingFrom` to `is_downloading_from` * refactor: change `isEncrypted` to `is_encrypted` * refactor: change `isIncoming` to `is_incoming` * refactor: change `isUploadingTo` to `is_uploading_to` * refactor: change `isUTP` to `is_utp` * refactor: change `peerIsChoked` to `peer_is_choked` * refactor: change `peerIsInterested` to `peer_is_interested` * refactor: change `rateToClient` to `rate_to_client` * refactor: change `rateToPeer` to `rate_to_peer` * refactor: change `fromCache` to `from_cache` * refactor: change `fromDht` to `from_dht` * refactor: change `fromIncoming` to `from_incoming` * refactor: change `fromLpd` to `from_lpd` * refactor: change `fromLtep` to `from_ltep` * refactor: change `fromPex` to `from_pex` * refactor: change `fromTracker` to `from_tracker` * refactor: change `announceState` to `announce_state` * refactor: change `downloadCount` to `download_count` * refactor: change `hasAnnounced` to `has_announced` * refactor: change `hasScraped` to `has_scraped` * refactor: change `isBackup` to `is_backup` * refactor: change `lastAnnouncePeerCount` to `last_announce_peer_count` * refactor: change `lastAnnounceResult` to `last_announce_result` * refactor: change `lastAnnounceStartTime` to `last_announce_start_time` * refactor: change `lastAnnounceSucceeded` to `last_announce_succeeded` * refactor: change `lastAnnounceTime` to `last_announce_time` * refactor: change `lastAnnounceTimedOut` to `last_announce_timed_out` * refactor: change `lastScrapeResult` to `last_scrape_result` * refactor: change `lastScrapeStartTime` to `last_scrape_start_time` * refactor: change `lastScrapeSucceeded` to `last_scrape_succeeded` * refactor: change `lastScrapeTime` to `last_scrape_time` * refactor: change `lastScrapeTimedOut` to `last_scrape_timed_out` * refactor: change `leecherCount` to `leecher_count` * refactor: change `nextAnnounceTime` to `next_announce_time` * refactor: change `nextScrapeTime` to `next_scrape_time` * refactor: change `scrapeState` to `scrape_state` * refactor: change `seederCount` to `seeder_count` * refactor: change `torrent-added` to `torrent_added` * refactor: change `torrent-duplicate` to `torrent_duplicate` * refactor: change `torrent-remove` to `torrent_remove` * refactor: change `delete-local-data` to `delete_local_data` * refactor: change `torrent-rename-path` to `torrent_rename_path` * refactor: change `alt-speed-down` to `alt_speed_down` * refactor: convert `pref_toggle_entries` to quark array * refactor: change `alt-speed-enabled` to `alt_speed_enabled` * refactor: change `compact-view` to `compact_view` * refactor: change `sort-reversed` to `sort_reversed` * refactor: change `show-filterbar` to `show_filterbar` * refactor: change `show-statusbar` to `show_statusbar` * refactor: change `show-toolbar` to `show_toolbar` * refactor: change `alt-speed-time-begin` to `alt_speed_time_begin` * refactor: change `alt-speed-time-day` to `alt_speed_time_day` * refactor: change `alt-speed-time-end` to `alt_speed_time_end` * refactor: change `alt-speed-up` to `alt_speed_up` * refactor: change `alt-speed-time-enabled` to `alt_speed_time_enabled` * refactor: change `blocklist-enabled` to `blocklist_enabled` * refactor: change `blocklist-size` to `blocklist_size` * refactor: change `blocklist-url` to `blocklist_url` * refactor: change `cache-size-mb` to `cache_size_mb` * refactor: change `config-dir` to `config_dir` * refactor: change `default-trackers` to `default_trackers` * refactor: change `dht-enabled` to `dht_enabled` * refactor: change `download-dir-free-space` to `download_dir_free_space` * refactor: change `download-queue-enabled` to `download_queue_enabled` * refactor: change `download-queue-size` to `download_queue_size` * refactor: change `idle-seeding-limit-enabled` to `idle_seeding_limit_enabled` * refactor: change `idle-seeding-limit` to `idle_seeding_limit` * refactor: change `incomplete-dir-enabled` to `incomplete_dir_enabled` * refactor: change `incomplete-dir` to `incomplete_dir` * refactor: change `lpd-enabled` to `lpd_enabled` * refactor: change `peer-limit-global` to `peer_limit_global` * refactor: change `peer-limit-per-torrent` to `peer_limit_per_torrent` * refactor: change `peer-port-random-on-start` to `peer_port_random_on_start` * refactor: change `peer-port` to `peer_port` * refactor: change `pex-enabled` to `pex_enabled` * refactor: change `port-forwarding-enabled` to `port_forwarding_enabled` * refactor: change `queue-stalled-enabled` to `queue_stalled_enabled` * refactor: change `queue-stalled-minutes` to `queue_stalled_minutes` * refactor: change `rename-partial-files` to `rename_partial_files` * refactor: change `rpc-version-minimum` to `rpc_version_minimum` * refactor: change `rpc-version-semver` to `rpc_version_semver` * refactor: change `rpc-version` to `rpc_version` * refactor: change `script-torrent-added-enabled` to `script_torrent_added_enabled` * refactor: change `script-torrent-added-filename` to `script_torrent_added_filename` * refactor: change `script-torrent-done-enabled` to `script_torrent_done_enabled` * refactor: change `script-torrent-done-filename` to `script_torrent_done_filename` * refactor: change `script-torrent-done-seeding-enabled` to `script_torrent_done_seeding_enabled` * refactor: change `script-torrent-done-seeding-filename` to `script_torrent_done_seeding_filename` * refactor: change `seed-queue-enabled` to `seed_queue_enabled` * refactor: change `seed-queue-size` to `seed_queue_size` * refactor: change `seedRatioLimited` to `seed_ratio_limited` * refactor: change `session-id` to `session_id` * refactor: change `speed-limit-down-enabled` to `speed_limit_down_enabled` * refactor: change `speed-limit-down` to `speed_limit_down` * refactor: change `speed-limit-up-enabled` to `speed_limit_up_enabled` * refactor: change `speed-limit-up` to `speed_limit_up` * refactor: change `start-added-torrents` to `start_added_torrents` * refactor: change `trash-original-torrent-files` to `trash_original_torrent_files` * refactor: change `utp-enabled` to `utp_enabled` * refactor: change `tcp-enabled` to `tcp_enabled` * docs: add missing docs for RPC `tcp_enabled` * refactor: change `speed-units` to `speed_units` * refactor: change `speed-bytes` to `speed_bytes` * refactor: change `size-units` to `size_units` * refactor: change `size-bytes` to `size_bytes` * refactor: change `memory-units` to `memory_units` * refactor: change `memory-bytes` to `memory_bytes` * refactor: change `session-set` to `session_set` * refactor: change `session-get` to `session_get` * refactor: change `session-stats` to `session_stats` * refactor: change `activeTorrentCount` to `active_torrent_count` * refactor: change `downloadSpeed` to `download_speed` * refactor: change `pausedTorrentCount` to `paused_torrent_count` * refactor: change `torrentCount` to `torrent_count` * refactor: change `uploadSpeed` to `upload_speed` * refactor: change `cumulative-stats` to `cumulative_stats` * refactor: change `current-stats` to `current_stats` * refactor: change `uploadedBytes` and `uploaded-bytes` to `uploaded_bytes` * refactor: change `downloadedBytes` and `downloaded-bytes` to `downloaded_bytes` * refactor: change `filesAdded` and `files-added` to `files_added` * refactor: change `sessionCount` and `session-count` to `session_count` * refactor: change `secondsActive` and `seconds-active` to `seconds_active` * refactor: change `blocklist-update` to `blocklist_update` * refactor: change `port-test` to `port_test` * refactor: change `session-close` to `session_close` * refactor: change `queue-move-top` to `queue_move_top` * refactor: change `queue-move-up` to `queue_move_up` * refactor: change `queue-move-down` to `queue_move_down` * refactor: change `queue-move-bottom` to `queue_move_bottom` * refactor: change `free-space` to `free_space` * refactor: change `group-set` to `group_set` * refactor: change `group-get` to `group_get` * refactor: change `announce-ip` to `announce_ip` * refactor: change `announce-ip-enabled` to `announce_ip_enabled` * refactor: change `upload-slots-per-torrent` to `upload_slots_per_torrent` * refactor: change `trash-can-enabled` to `trash_can_enabled` * refactor: change `watch-dir-enabled` to `watch_dir_enabled` * refactor: change `watch-dir-force-generic` to `watch_dir_force_generic` * refactor: change `watch-dir` to `watch_dir` * refactor: change `message-level` to `message_level` * refactor: change `scrape-paused-torrents-enabled` to `scrape_paused_torrents_enabled` * refactor: change `torrent-added-verify-mode` to `torrent_added_verify_mode` * refactor: change `sleep-per-seconds-during-verify` to `sleep_per_seconds_during_verify` * refactor: change `bind-address-ipv4` to `bind_address_ipv4` * refactor: change `bind-address-ipv6` to `bind_address_ipv6` * refactor: change `peer-congestion-algorithm` to `peer_congestion_algorithm` * refactor: change `peer-socket-tos` to `peer_socket_tos` * refactor: change `peer-port-random-high` to `peer_port_random_high` * refactor: change `peer-port-random-low` to `peer_port_random_low` * refactor: change `anti-brute-force-enabled` to `anti_brute_force_enabled` * refactor: change `rpc-authentication-required` to `rpc_authentication_required` * refactor: change `rpc-bind-address` to `rpc_bind_address` * refactor: change `rpc-enabled` to `rpc_enabled` * refactor: change `rpc-host-whitelist` to `rpc_host_whitelist` * refactor: change `rpc-host-whitelist-enabled` to `rpc_host_whitelist_enabled` * refactor: change `rpc-password` to `rpc_password` * refactor: change `rpc-port` to `rpc_port` * refactor: change `rpc-socket-mode` to `rpc_socket_mode` * refactor: change `rpc-url` to `rpc_url` * refactor: change `rpc-username` to `rpc_username` * refactor: change `rpc-whitelist` to `rpc_whitelist` * refactor: change `rpc-whitelist-enabled` to `rpc_whitelist_enabled` * refactor: change `ratio-limit-enabled` to `ratio_limit_enabled` * refactor: change `ratio-limit` to `ratio_limit` * refactor: change `show-options-window` to `show_options_window` * refactor: change `open-dialog-dir` to `open_dialog_dir` * refactor: change `inhibit-desktop-hibernation` to `inhibit_desktop_hibernation` * refactor: change `show-notification-area-icon` to `show_notification_area_icon` * refactor: change `start-minimized` to `start_minimized` * refactor: change `torrent-added-notification-enabled` to `torrent_added_notification_enabled` * refactor: change `anti-brute-force-threshold` to `anti_brute_force_threshold` * refactor: change `torrent-complete-notification-enabled` to `torrent_complete_notification_enabled` * refactor: change `prompt-before-exit` to `prompt_before_exit` * refactor: change `sort-mode` to `sort_mode` * refactor: change `statusbar-stats` to `statusbar_stats` * refactor: change `show-extra-peer-details` to `show_extra_peer_details` * refactor: change `show-backup-trackers` to `show_backup_trackers` * refactor: change `blocklist-date` to `blocklist_date` * refactor: change `blocklist-updates-enabled` to `blocklist_updates_enabled` * refactor: change `main-window-layout-order` to `main_window_layout_order` * refactor: change `main-window-height` to `main_window_height` * refactor: change `main-window-width` to `main_window_width` * refactor: change `main-window-x` to `main_window_x` * refactor: change `main-window-y` to `main_window_y` * refactor: change `filter-mode` to `filter_mode` * refactor: change `filter-trackers` to `filter_trackers` * refactor: change `filter-text` to `filter_text` * refactor: change `remote-session-enabled` to `remote_session_enabled` * refactor: change `remote-session-host` to `remote_session_host` * refactor: change `remote-session-https` to `remote_session_https` * refactor: change `remote-session-password` to `remote_session_password` * refactor: change `remote-session-port` to `remote_session_port` * refactor: change `remote-session-requres-authentication` to `remote_session_requires_authentication` * refactor: change `remote-session-username` to `remote_session_username` * refactor: change `torrent-complete-sound-command` to `torrent_complete_sound_command` * refactor: change `torrent-complete-sound-enabled` to `torrent_complete_sound_enabled` * refactor: change `user-has-given-informed-consent` to `user_has_given_informed_consent` * refactor: change `read-clipboard` to `read_clipboard` * refactor: change `details-window-height` to `details_window_height` * refactor: change `details-window-width` to `details_window_width` * refactor: change `main-window-is-maximized` to `main_window_is_maximized` * refactor: change `port-is-open` to `port_is_open` * refactor: change `show-tracker-scrapes` to `show_tracker_scrapes` * refactor: change `max-peers` to `max_peers` * refactor: change `peers2-6` to `peers2_6` * refactor: change `seeding-time-seconds` to `seeding_time_seconds` * refactor: change `downloading-time-seconds` to `downloading_time_seconds` * refactor: change `ratio-mode` to `ratio_mode` * refactor: change `idle-limit` to `idle_limit` * refactor: change `idle-mode` to `idle_mode` * refactor: change `speed-Bps` to `speed_Bps` * refactor: change `use-global-speed-limit` to `use_global_speed_limit` * refactor: change `use-speed-limit` to `use_speed_limit` * chore: remove TODO comment * docs: add upgrade instructions to `5.0.0` * chore: bump rpc semver major version * chore: housekeeping
This commit is contained in:
19
cli/cli.cc
19
cli/cli.cc
@@ -346,25 +346,6 @@ int tr_main(int argc, char* argv[])
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (auto sv = std::string_view{}; tr_variantDictFindStrView(&settings, TR_KEY_download_dir, &sv))
|
||||
{
|
||||
auto const sz_download_dir = std::string{ sv };
|
||||
|
||||
if (!tr_sys_path_exists(sz_download_dir))
|
||||
{
|
||||
if (auto error = tr_error{}; !tr_sys_dir_create(sz_download_dir, TR_SYS_DIR_CREATE_PARENTS, 0700, &error) && error)
|
||||
{
|
||||
auto const errmsg = fmt::format(
|
||||
"Couldn't create '{path}': {error} ({error_code})",
|
||||
fmt::arg("path", sz_download_dir),
|
||||
fmt::arg("error", error.message()),
|
||||
fmt::arg("error_code", error.code()));
|
||||
fmt::print(stderr, "{:s}\n", errmsg);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto* const h = tr_sessionInit(config_dir.c_str(), false, settings);
|
||||
auto* const ctor = tr_ctorNew(h);
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ Transmission stores blocklists in a folder named `blocklists` in its [configurat
|
||||
In that directory, files ending in ".bin" are blocklists that Transmission has parsed into a binary format suitable for quick lookups. When Transmission starts, it scans this directory for files not ending in ".bin" and tries to parse them. So to add another blocklist, all you have to do is put it in this directory and restart Transmission. Text and gzip formats are supported.
|
||||
|
||||
## Using blocklists in transmission-daemon ##
|
||||
transmission-daemon does not have an "update blocklist" button, so its users have two options. They can either copy blocklists from transmission-gtk's directory to transmission-daemon's directory, or they can download a blocklist by hand, uncompress it, and place it in the daemon's `blocklists` folder. In both cases, the daemon's [settings.json file](Configuration-Files.md) will need to be edited to set "blocklist-enabled" to "true".
|
||||
transmission-daemon does not have an "update blocklist" button, so its users have two options. They can either copy blocklists from transmission-gtk's directory to transmission-daemon's directory, or they can download a blocklist by hand, uncompress it, and place it in the daemon's `blocklists` folder. In both cases, the daemon's [settings.json file](Configuration-Files.md) will need to be edited to set "blocklist_enabled" to "true".
|
||||
|
||||
In both cases the daemon is unaware of blocklist updates. Only when it starts it creates new .bin files.
|
||||
|
||||
@@ -23,8 +23,8 @@ There is a third option: add the blocklist URL in settings.json (only one blockl
|
||||
|
||||
settings.json snippet:
|
||||
```json
|
||||
"blocklist-enabled": true,
|
||||
"blocklist-url": "http://www.example.com/blocklist",
|
||||
"blocklist_enabled": true,
|
||||
"blocklist_url": "http://www.example.com/blocklist",
|
||||
```
|
||||
|
||||
Manual update example:
|
||||
|
||||
@@ -5,6 +5,18 @@ Note: The client _should_ be closed before making changes, otherwise settings wi
|
||||
Some of Transmission's behavior can also be customized via environment variables.
|
||||
|
||||
# GTK / Daemon / CLI
|
||||
|
||||
> [!IMPORTANT]
|
||||
> Transmisson 4.1.0 converted all configuration strings to snake_case.
|
||||
>
|
||||
> Your configuration file will be converted to snake_case automatically by running and stopping Transmission.
|
||||
> Please keep a backup before upgrading if needed.
|
||||
>
|
||||
> The old kebab-case strings are still accepted in Transmission 4 but are deprecated and will be removed in the future.
|
||||
>
|
||||
> For documentation of the old configurations, please consult documentation from previous versions.
|
||||
> https://github.com/transmission/transmission/blob/4.0.6/docs/Editing-Configuration-Files.md
|
||||
|
||||
### Overview
|
||||
GTK, CLI and daemon (both on a Mac and Linux) use a [JSON](https://www.json.org/) formatted file, mainly because of its human readability.
|
||||
(Consult the [JSON website](https://www.json.org/) for detailed information)
|
||||
@@ -25,126 +37,126 @@ Here is a sample of the three basic types: respectively Boolean, Number and Stri
|
||||
|
||||
```json
|
||||
{
|
||||
"rpc-enabled": true,
|
||||
"peer-port": 51413,
|
||||
"rpc-whitelist": "127.0.0.1,192.168.*.*"
|
||||
"rpc_enabled": true,
|
||||
"peer_port": 51413,
|
||||
"rpc_whitelist": "127.0.0.1,192.168.*.*"
|
||||
}
|
||||
```
|
||||
|
||||
### Options
|
||||
#### IP Announce
|
||||
|
||||
* **announce-ip:** String (default = "") Alternative IP address to announce to the tracker.
|
||||
* **announce-ip-enabled:** Boolean (default = false) When enabled **announce-ip** value is used instead of the client's address visible to the tracker for announcement requests.
|
||||
* **announce_ip:** String (default = "") Alternative IP address to announce to the tracker.
|
||||
* **announce_ip_enabled:** Boolean (default = false) When enabled `announce_ip` value is used instead of the client's address visible to the tracker for announcement requests.
|
||||
|
||||
#### Bandwidth
|
||||
|
||||
* **alt-speed-enabled:** Boolean (default = false, aka 'Turtle Mode')
|
||||
* **alt_speed_enabled:** Boolean (default = false, aka 'Turtle Mode')
|
||||
_Note: Clicking the "Turtle" in the GUI when the [scheduler](#Scheduling) is enabled, will only temporarily remove the scheduled limit until the next cycle._
|
||||
* **alt-speed-up:** Number (kB/s, default = 50)
|
||||
* **alt-speed-down:** Number (kB/s, default = 50)
|
||||
* **speed-limit-down:** Number (kB/s, default = 100)
|
||||
* **speed-limit-down-enabled:** Boolean (default = false)
|
||||
* **speed-limit-up:** Number (kB/s, default = 100)
|
||||
* **speed-limit-up-enabled:** Boolean (default = false)
|
||||
* **upload-slots-per-torrent:** Number (default = 14)
|
||||
* **alt_speed_up:** Number (kB/s, default = 50)
|
||||
* **alt_speed_down:** Number (kB/s, default = 50)
|
||||
* **speed_limit_down:** Number (kB/s, default = 100)
|
||||
* **speed_limit_down_enabled:** Boolean (default = false)
|
||||
* **speed_limit_up:** Number (kB/s, default = 100)
|
||||
* **speed_limit_up_enabled:** Boolean (default = false)
|
||||
* **upload_slots_per_torrent:** Number (default = 14)
|
||||
|
||||
#### [Blocklists](./Blocklists.md)
|
||||
|
||||
* **blocklist-url:** String (default = https://www.example.com/blocklist)
|
||||
* **blocklist-enabled:** Boolean (default = false)
|
||||
* **blocklist_url:** String (default = https://www.example.com/blocklist)
|
||||
* **blocklist_enabled:** Boolean (default = false)
|
||||
|
||||
#### [Files and Locations](./Configuration-Files.md)
|
||||
|
||||
* **download-dir:** String (default = [default locations](Configuration-Files.md#Locations))
|
||||
* **incomplete-dir:** String (default = [default locations](Configuration-Files.md#Locations)) Directory to keep files in until torrent is complete.
|
||||
* **incomplete-dir-enabled:** Boolean (default = false) When enabled, new torrents will download the files to **incomplete-dir**. When complete, the files will be moved to **download-dir**.
|
||||
* **download_dir:** String (default = [default locations](Configuration-Files.md#Locations))
|
||||
* **incomplete_dir:** String (default = [default locations](Configuration-Files.md#Locations)) Directory to keep files in until torrent is complete.
|
||||
* **incomplete_dir_enabled:** Boolean (default = false) When enabled, new torrents will download the files to `incomplete_dir`. When complete, the files will be moved to `download_dir`.
|
||||
* **preallocation:** Number (0 = Off, 1 = Fast, 2 = Full (slower but reduces disk fragmentation), default = 1)
|
||||
* **rename-partial-files:** Boolean (default = true) Postfix partially downloaded files with ".part".
|
||||
* **start-added-torrents:** Boolean (default = true) Start torrents as soon as they are added.
|
||||
* **trash-can-enabled:** Boolean (default = true) Whether to move the torrents to the system's trashcan or unlink them right away upon deletion from Transmission.
|
||||
* **rename_partial_files:** Boolean (default = true) Postfix partially downloaded files with ".part".
|
||||
* **start_added_torrents:** Boolean (default = true) Start torrents as soon as they are added.
|
||||
* **trash_can_enabled:** Boolean (default = true) Whether to move the torrents to the system's trashcan or unlink them right away upon deletion from Transmission.
|
||||
_Note: transmission-gtk only._
|
||||
* **trash-original-torrent-files:** Boolean (default = false) Delete torrents added from the watch directory.
|
||||
* **trash_original_torrent_files:** Boolean (default = false) Delete torrents added from the watch directory.
|
||||
* **umask:** String (default = "022") Sets Transmission's file mode creation mask. See [the umask(2) manpage](https://man7.org/linux/man-pages/man2/umask.2.html) for more information.
|
||||
* **watch-dir:** String
|
||||
* **watch-dir-enabled:** Boolean (default = false) Watch a directory for torrent files and add them to Transmission.
|
||||
_Note: When **watch-dir-enabled** is true, only the transmission-daemon, transmission-gtk, and transmission-qt applications will monitor **watch-dir** for new .torrent files and automatically load them._
|
||||
* **watch-dir-force-generic**: Boolean (default = false) Force to use a watch directory implementation that does not rely on OS-specific mechanisms. Useful when your watch directory is on a network location, such as CIFS or NFS.
|
||||
* **watch_dir:** String
|
||||
* **watch_dir_enabled:** Boolean (default = false) Watch a directory for torrent files and add them to Transmission.
|
||||
_Note: When `watch_dir_enabled` is true, only the transmission-daemon, transmission-gtk, and transmission-qt applications will monitor `watch_dir` for new .torrent files and automatically load them._
|
||||
* **watch_dir_force_generic**: Boolean (default = false) Force to use a watch directory implementation that does not rely on OS-specific mechanisms. Useful when your watch directory is on a network location, such as CIFS or NFS.
|
||||
_Note: transmission-daemon only._
|
||||
|
||||
#### Misc
|
||||
* **cache-size-mb:** Number (default = 4), in MiB, to allocate for Transmission's memory cache. The cache is used to help batch disk IO together, so increasing the cache size can be used to reduce the number of disk reads and writes. The value is the total available to the Transmission instance. Set it to the smallest value tolerable by the random access performance of your storage medium to minimize data loss in case Transmission quit unexpectedly. Setting this to 0 bypasses the cache, which may be useful if your filesystem already has a cache layer that aggregates transactions. Pieces are guaranteed to be written to filesystem if sequential download is enabled. Otherwise, data might still be in cache only.
|
||||
* **default-trackers:** String (default = "") A list of double-newline separated tracker announce URLs. These are used for all torrents in addition to the per torrent trackers specified in the torrent file. If a tracker is only meant to be a backup, it should be separated from its main tracker by a single newline character. If a tracker should be used additionally to another tracker it should be separated by two newlines. (e.g. "udp://tracker.example.invalid:1337/announce\n\nudp://tracker.another-example.invalid:6969/announce\nhttps://backup-tracker.another-example.invalid:443/announce\n\nudp://tracker.yet-another-example.invalid:1337/announce", in this case tracker.example.invalid, tracker.another-example.invalid and tracker.yet-another-example.invalid would be used as trackers and backup-tracker.another-example.invalid as backup in case tracker.another-example.invalid is unreachable.
|
||||
* **dht-enabled:** Boolean (default = true) Enable [Distributed Hash Table (DHT)](https://wiki.theory.org/BitTorrentSpecification#Distributed_Hash_Table).
|
||||
* **cache_size_mb:** Number (default = 4), in MiB, to allocate for Transmission's memory cache. The cache is used to help batch disk IO together, so increasing the cache size can be used to reduce the number of disk reads and writes. The value is the total available to the Transmission instance. Set it to the smallest value tolerable by the random access performance of your storage medium to minimize data loss in case Transmission quit unexpectedly. Setting this to 0 bypasses the cache, which may be useful if your filesystem already has a cache layer that aggregates transactions. Pieces are guaranteed to be written to filesystem if sequential download is enabled. Otherwise, data might still be in cache only.
|
||||
* **default_trackers:** String (default = "") A list of double-newline separated tracker announce URLs. These are used for all torrents in addition to the per torrent trackers specified in the torrent file. If a tracker is only meant to be a backup, it should be separated from its main tracker by a single newline character. If a tracker should be used additionally to another tracker it should be separated by two newlines. (e.g. "udp://tracker.example.invalid:1337/announce\n\nudp://tracker.another-example.invalid:6969/announce\nhttps://backup-tracker.another-example.invalid:443/announce\n\nudp://tracker.yet-another-example.invalid:1337/announce", in this case tracker.example.invalid, tracker.another-example.invalid and tracker.yet-another-example.invalid would be used as trackers and backup-tracker.another-example.invalid as backup in case tracker.another-example.invalid is unreachable.
|
||||
* **dht_enabled:** Boolean (default = true) Enable [Distributed Hash Table (DHT)](https://wiki.theory.org/BitTorrentSpecification#Distributed_Hash_Table).
|
||||
* **encryption:** Number (0 = Prefer unencrypted connections, 1 = Prefer encrypted connections, 2 = Require encrypted connections; default = 1) [Encryption](https://wiki.vuze.com/w/Message_Stream_Encryption) preference. Encryption may help get around some ISP filtering, but at the cost of slightly higher CPU use.
|
||||
* **lpd-enabled:** Boolean (default = false) Enable [Local Peer Discovery (LPD)](https://en.wikipedia.org/wiki/Local_Peer_Discovery).
|
||||
* **message-level:** Number (0 = None, 1 = Critical, 2 = Error, 3 = Warn, 4 = Info, 5 = Debug, 6 = Trace; default = 4) Set verbosity of Transmission's log messages.
|
||||
* **pex-enabled:** Boolean (default = true) Enable [Peer Exchange (PEX)](https://en.wikipedia.org/wiki/Peer_exchange).
|
||||
* **lpd_enabled:** Boolean (default = false) Enable [Local Peer Discovery (LPD)](https://en.wikipedia.org/wiki/Local_Peer_Discovery).
|
||||
* **message_level:** Number (0 = None, 1 = Critical, 2 = Error, 3 = Warn, 4 = Info, 5 = Debug, 6 = Trace; default = 4) Set verbosity of Transmission's log messages.
|
||||
* **pex_enabled:** Boolean (default = true) Enable [Peer Exchange (PEX)](https://en.wikipedia.org/wiki/Peer_exchange).
|
||||
* **pidfile:** String Path to file in which daemon PID will be stored (_transmission-daemon only_)
|
||||
* **proxy_url:** String? (default = null) Proxy for HTTP(S) requests (for example, requests to tracker). Format `[scheme]://[host]:[port]`, where `scheme` is one of: `http`, `https`, `socks4`, `socks4h`, `socks5`, `socks5h`. If null, Transmission respects the CURL environment variables. If empty string, no proxy is used. For more information see [curl proxy documentation](https://curl.se/libcurl/c/CURLOPT_PROXY.html)
|
||||
* **scrape-paused-torrents-enabled:** Boolean (default = true)
|
||||
* **script-torrent-added-enabled:** Boolean (default = false) Run a script when a torrent is added to Transmission. Environmental variables are passed in as detailed on the [Scripts](./Scripts.md) page.
|
||||
* **script-torrent-added-filename:** String (default = "") Path to script.
|
||||
* **script-torrent-done-enabled:** Boolean (default = false) Run a script when a torrent is done downloading. Environmental variables are passed in as detailed on the [Scripts](./Scripts.md) page.
|
||||
* **script-torrent-done-filename:** String (default = "") Path to script.
|
||||
* **script-torrent-done-seeding-enabled:** Boolean (default = false) Run a script when a torrent is done seeding. Environmental variables are passed in as detailed on the [Scripts](./Scripts.md) page.
|
||||
* **script-torrent-done-seeding-filename:** String (default = "") Path to script.
|
||||
* **scrape_paused_torrents_enabled:** Boolean (default = true)
|
||||
* **script_torrent_added_enabled:** Boolean (default = false) Run a script when a torrent is added to Transmission. Environmental variables are passed in as detailed on the [Scripts](./Scripts.md) page.
|
||||
* **script_torrent_added_filename:** String (default = "") Path to script.
|
||||
* **script_torrent_done_enabled:** Boolean (default = false) Run a script when a torrent is done downloading. Environmental variables are passed in as detailed on the [Scripts](./Scripts.md) page.
|
||||
* **script_torrent_done_filename:** String (default = "") Path to script.
|
||||
* **script_torrent_done_seeding_enabled:** Boolean (default = false) Run a script when a torrent is done seeding. Environmental variables are passed in as detailed on the [Scripts](./Scripts.md) page.
|
||||
* **script_torrent_done_seeding_filename:** String (default = "") Path to script.
|
||||
* **start_paused**: Boolean (default = false) Pause the torrents when daemon starts. _Note: transmission-daemon only._
|
||||
* **tcp-enabled:** Boolean (default = true) **DEPRECATED**, use `preferred_transports` instead. Leave it at default and let Transmission manage this value to minimize accidents.
|
||||
* **torrent-added-verify-mode:** String ("fast", "full", default: "fast") Whether newly-added torrents' local data should be fully verified when added, or wait and verify them on-demand later. See [#2626](https://github.com/transmission/transmission/pull/2626) for more discussion.
|
||||
* **tcp_enabled:** Boolean (default = true) **DEPRECATED**, use `preferred_transports` instead. Leave it at default and let Transmission manage this value to minimize accidents.
|
||||
* **torrent_added_verify_mode:** String ("fast", "full", default: "fast") Whether newly-added torrents' local data should be fully verified when added, or wait and verify them on-demand later. See [#2626](https://github.com/transmission/transmission/pull/2626) for more discussion.
|
||||
* **torrent_complete_verify_enabled**: Boolean (default = false) Whether to verify the torrent once it finishes downloading.
|
||||
* **utp-enabled:** Boolean (default = true) ***DEPRECATED***, use `preferred_transports` instead. Leave it at default and let Transmission manage this value to minimize accidents.
|
||||
* **utp_enabled:** Boolean (default = true) ***DEPRECATED***, use `preferred_transports` instead. Leave it at default and let Transmission manage this value to minimize accidents.
|
||||
* **preferred_transports:** String[] ("utp" = [Micro Transport Protocol (µTP)](https://en.wikipedia.org/wiki/Micro_Transport_Protocol), "tcp" = TCP; default = ["utp", "tcp"]) List your preference of transport protocols in the order of preferred-first. Omitting the transport protocol from the list will disable it.
|
||||
_Note: Never disable TCP when you also disable µTP, because then your client would not be able to communicate. Disabling TCP might also break webseeds._
|
||||
* **sleep-per-seconds-during-verify:** Number (default = 100) Controls the duration in milliseconds for which the verification process will pause to reduce disk I/O pressure.
|
||||
* **sleep_per_seconds_during_verify:** Number (default = 100) Controls the duration in milliseconds for which the verification process will pause to reduce disk I/O pressure.
|
||||
|
||||
#### Peers
|
||||
* **bind-address-ipv4:** String (default = "") Where to listen for peer connections. When no valid IPv4 address is provided, Transmission will bind to "0.0.0.0".
|
||||
* **bind-address-ipv6:** String (default = "") Where to listen for peer connections. When no valid IPv6 address is provided, Transmission will try to bind to your default global IPv6 address. If that didn't work, then Transmission will bind to "::".
|
||||
* **peer-congestion-algorithm:** String. This is documented on https://www.pps.jussieu.fr/~jch/software/bittorrent/tcp-congestion-control.html.
|
||||
* **peer-limit-global:** Number (default = 200)
|
||||
* **peer-limit-per-torrent:** Number (default = 50)
|
||||
* **peer-socket-tos:** String (default = "le") Set the [DiffServ](https://en.wikipedia.org/wiki/Differentiated_services) parameter for outgoing packets. Allowed values are lowercase DSCP names. See the `tr_tos_t` class from `libtransmission/net.h` for the exact list of possible values.
|
||||
* **bind_address_ipv4:** String (default = "") Where to listen for peer connections. When no valid IPv4 address is provided, Transmission will bind to "0.0.0.0".
|
||||
* **bind_address_ipv6:** String (default = "") Where to listen for peer connections. When no valid IPv6 address is provided, Transmission will try to bind to your default global IPv6 address. If that didn't work, then Transmission will bind to "::".
|
||||
* **peer_congestion_algorithm:** String. This is documented on https://www.pps.jussieu.fr/~jch/software/bittorrent/tcp-congestion-control.html.
|
||||
* **peer_limit_global:** Number (default = 200)
|
||||
* **peer_limit_per_torrent:** Number (default = 50)
|
||||
* **peer_socket_tos:** String (default = "le") Set the [DiffServ](https://en.wikipedia.org/wiki/Differentiated_services) parameter for outgoing packets. Allowed values are lowercase DSCP names. See the `tr_tos_t` class from `libtransmission/net.h` for the exact list of possible values.
|
||||
* **reqq:** Number (default = 2000) The number of outstanding block requests a peer is allowed to queue in the client. The higher this number, the higher the max possible upload speed towards each peer.
|
||||
* **sequential_download** Boolean (default = false) Enable sequential download by default when adding torrents.
|
||||
|
||||
#### Peer Port
|
||||
* **peer-port:** Number (default = 51413)
|
||||
* **peer-port-random-high:** Number (default = 65535)
|
||||
* **peer-port-random-low:** Number (default = 1024)
|
||||
* **peer-port-random-on-start:** Boolean (default = false)
|
||||
* **port-forwarding-enabled:** Boolean (default = true) Enable [UPnP](https://en.wikipedia.org/wiki/Universal_Plug_and_Play) or [NAT-PMP](https://en.wikipedia.org/wiki/NAT_Port_Mapping_Protocol).
|
||||
* **peer_port:** Number (default = 51413)
|
||||
* **peer_port_random_high:** Number (default = 65535)
|
||||
* **peer_port_random_low:** Number (default = 1024)
|
||||
* **peer_port_random_on_start:** Boolean (default = false)
|
||||
* **port_forwarding_enabled:** Boolean (default = true) Enable [UPnP](https://en.wikipedia.org/wiki/Universal_Plug_and_Play) or [NAT-PMP](https://en.wikipedia.org/wiki/NAT_Port_Mapping_Protocol).
|
||||
|
||||
#### Queuing
|
||||
* **download-queue-enabled:** Boolean (default = true) When true, Transmission will only download `download-queue-size` non-stalled torrents at once.
|
||||
* **download-queue-size:** Number (default = 5) See download-queue-enabled.
|
||||
* **queue-stalled-enabled:** Boolean (default = true) When true, torrents that have not shared data for `queue-stalled-minutes` are treated as 'stalled' and are not counted against the `download-queue-size` and `seed-queue-size` limits.
|
||||
* **queue-stalled-minutes:** Number (default = 30) See queue-stalled-enabled.
|
||||
* **seed-queue-enabled:** Boolean (default = false) When true. Transmission will only seed `seed-queue-size` non-stalled torrents at once.
|
||||
* **seed-queue-size:** Number (default = 10) See seed-queue-enabled.
|
||||
* **download_queue_enabled:** Boolean (default = true) When true, Transmission will only download `download_queue_size` non-stalled torrents at once.
|
||||
* **download_queue_size:** Number (default = 5) See `download_queue_enabled`.
|
||||
* **queue_stalled_enabled:** Boolean (default = true) When true, torrents that have not shared data for `queue_stalled_minutes` are treated as 'stalled' and are not counted against the `download_queue_size` and `seed_queue_size` limits.
|
||||
* **queue_stalled_minutes:** Number (default = 30) See `queue_stalled_enabled`.
|
||||
* **seed_queue_enabled:** Boolean (default = false) When true. Transmission will only seed `seed_queue_size` non-stalled torrents at once.
|
||||
* **seed_queue_size:** Number (default = 10) See `seed_queue_enabled`.
|
||||
|
||||
#### [RPC](rpc-spec.md)
|
||||
* **anti-brute-force-enabled:**: Boolean (default = false) Enable a very basic brute force protection for the RPC server. See "anti-brute-force-threshold" below.
|
||||
* **anti-brute-force-threshold:**: Number (default = 100) After this amount of failed authentication attempts is surpassed, the RPC server will deny any further authentication attempts until it is restarted. This is not tracked per IP but in total.
|
||||
* **rpc-authentication-required:** Boolean (default = false)
|
||||
* **rpc-bind-address:** String (default = "0.0.0.0") Where to listen for RPC connections
|
||||
* **rpc-enabled:** Boolean (default = true \[transmission-daemon\], false \[others\])
|
||||
* **rpc-host-whitelist:** String (Comma-delimited list of domain names. Wildcards allowed using '\*'. Example: "*.foo.org,example.com", Default: "", Always allowed: "localhost", "localhost.", all the IP addresses. Added in v2.93)
|
||||
* **rpc-host-whitelist-enabled:** Boolean (default = true. Added in v2.93)
|
||||
* **rpc-password:** String. You can enter this in as plaintext when Transmission is not running, and then Transmission will salt the value on startup and re-save the salted version as a security measure. **Note:** Transmission treats passwords starting with the character `{` as salted, so when you first create your password, the plaintext password you enter must not begin with `{`.
|
||||
* **rpc-port:** Number (default = 9091)
|
||||
* **rpc-socket-mode:** String UNIX filesystem mode for the RPC UNIX socket (default: 0750; used when `rpc-bind-address` is a UNIX socket)
|
||||
* **rpc-url:** String (default = /transmission/. Added in v2.2)
|
||||
* **rpc-username:** String
|
||||
* **rpc-whitelist:** String (Comma-delimited list of IP addresses. Wildcards allowed using '\*'. Example: "127.0.0.\*,192.168.\*.\*", Default: "127.0.0.1")
|
||||
* **rpc-whitelist-enabled:** Boolean (default = true)
|
||||
* **anti_brute_force_enabled:**: Boolean (default = false) Enable a very basic brute force protection for the RPC server. See `anti_brute_force_threshold` below.
|
||||
* **anti_brute_force_threshold:**: Number (default = 100) After this amount of failed authentication attempts is surpassed, the RPC server will deny any further authentication attempts until it is restarted. This is not tracked per IP but in total.
|
||||
* **rpc_authentication_required:** Boolean (default = false)
|
||||
* **rpc_bind_address:** String (default = "0.0.0.0") Where to listen for RPC connections
|
||||
* **rpc_enabled:** Boolean (default = true \[transmission-daemon\], false \[others\])
|
||||
* **rpc_host_whitelist:** String (Comma-delimited list of domain names. Wildcards allowed using '\*'. Example: "*.foo.org,example.com", Default: "", Always allowed: "localhost", "localhost.", all the IP addresses. Added in v2.93)
|
||||
* **rpc_host_whitelist_enabled:** Boolean (default = true. Added in v2.93)
|
||||
* **rpc_password:** String. You can enter this in as plaintext when Transmission is not running, and then Transmission will salt the value on startup and re-save the salted version as a security measure. **Note:** Transmission treats passwords starting with the character `{` as salted, so when you first create your password, the plaintext password you enter must not begin with `{`.
|
||||
* **rpc_port:** Number (default = 9091)
|
||||
* **rpc_socket_mode:** String UNIX filesystem mode for the RPC UNIX socket (default: 0750; used when `rpc_bind_address` is a UNIX socket)
|
||||
* **rpc_url:** String (default = /transmission/. Added in v2.2)
|
||||
* **rpc_username:** String
|
||||
* **rpc_whitelist:** String (Comma-delimited list of IP addresses. Wildcards allowed using '\*'. Example: "127.0.0.\*,192.168.\*.\*", Default: "127.0.0.1")
|
||||
* **rpc_whitelist_enabled:** Boolean (default = true)
|
||||
|
||||
#### Scheduling
|
||||
* **alt-speed-time-enabled:** Boolean (default = false)
|
||||
_Note: When enabled, this will toggle the **alt-speed-enabled** setting._
|
||||
* **alt-speed-time-begin:** Number (default = 540, in minutes from midnight, 9am)
|
||||
* **alt-speed-time-end:** Number (default = 1020, in minutes from midnight, 5pm)
|
||||
* **alt-speed-time-day:** Number/bitfield (default = 127, all days)
|
||||
* **alt_speed_time_enabled:** Boolean (default = false)
|
||||
_Note: When enabled, this will toggle the `alt_speed_enabled` setting._
|
||||
* **alt_speed_time_begin:** Number (default = 540, in minutes from midnight, 9am)
|
||||
* **alt_speed_time_end:** Number (default = 1020, in minutes from midnight, 5pm)
|
||||
* **alt_speed_time_day:** Number/bitfield (default = 127, all days)
|
||||
* Start with 0, then for each day you want the scheduler enabled, add:
|
||||
* **Sunday**: 1 (binary: `0000001`)
|
||||
* **Monday**: 2 (binary: `0000010`)
|
||||
@@ -157,10 +169,10 @@ Here is a sample of the three basic types: respectively Boolean, Number and Stri
|
||||
* **Weekdays**: 62 (binary: `0111110`)
|
||||
* **Weekends**: 65 (binary: `1000001`)
|
||||
* **All Days**: 127 (binary: `1111111`)
|
||||
* **idle-seeding-limit:** Number (default = 30) Stop seeding after being idle for _N_ minutes.
|
||||
* **idle-seeding-limit-enabled:** Boolean (default = false)
|
||||
* **ratio-limit:** Number (default = 2.0)
|
||||
* **ratio-limit-enabled:** Boolean (default = false)
|
||||
* **idle_seeding_limit:** Number (default = 30) Stop seeding after being idle for _N_ minutes.
|
||||
* **idle_seeding_limit_enabled:** Boolean (default = false)
|
||||
* **ratio_limit:** Number (default = 2.0)
|
||||
* **ratio_limit_enabled:** Boolean (default = false)
|
||||
|
||||
### Legacy Options
|
||||
Only keys that differ from above are listed here. These options have been replaced in newer versions of Transmission.
|
||||
@@ -196,7 +208,7 @@ Only keys that differ from above are listed here. These options have been replac
|
||||
##### [RPC](rpc-spec.md)
|
||||
* **rpc-access-control-list:** String (Comma-delimited list of IP addresses prefixed with "+" or "-". Wildcards allowed using '\*'. Example: "+127.0.0.\*,-192.168.\*.\*", Default: "+127.0.0.1")
|
||||
|
||||
## macOS
|
||||
# macOS
|
||||
### Overview
|
||||
macOS has a standardized way of saving user preferences files using [XML](https://en.wikipedia.org/wiki/XML) format. These files are called [plist](https://en.wikipedia.org/wiki/Plist) (short for property list) files. Usually there is no need to modify these files directly, since Apple provided a [command-line tool](https://developer.apple.com/DOCUMENTATION/Darwin/Reference/ManPages/man1/defaults.1.html) to reliably change settings. You do need to restart Transmission before these have effect.
|
||||
|
||||
@@ -206,5 +218,5 @@ In short:
|
||||
|
||||
### Options
|
||||
* **PeerSocketTOS:** Number (Default = 0)
|
||||
* **RPCHostWhitelist:** String, see "rpc-host-whitelist" above.
|
||||
* **RPCUseHostWhitelist:** Boolean, see "rpc-host-whitelist-enabled" above.
|
||||
* **RPCHostWhitelist:** String, see `rpc_host_whitelist` above.
|
||||
* **RPCUseHostWhitelist:** Boolean, see `rpc_host_whitelist_enabled` above.
|
||||
|
||||
@@ -48,22 +48,22 @@ Now, the config file can be edited. Some settings to draw your attention to:
|
||||
{
|
||||
...
|
||||
# The default download directory.
|
||||
"download-dir": "/home/youruser/Downloads",
|
||||
"download_dir": "/home/youruser/Downloads",
|
||||
...
|
||||
# Reduce the global peer limit if your router is low on memory.
|
||||
"peer-limit-global": 32,
|
||||
"peer_limit_global": 32,
|
||||
...
|
||||
# For manual port forwarding. This controls the TCP and UDP bittorrent ports.
|
||||
"peer-port": 32768,
|
||||
"peer_port": 32768,
|
||||
...
|
||||
# Reject RPC commands from anybody except localhost. For untrusted LANs.
|
||||
"rpc-bind-address": "127.0.0.1",
|
||||
"rpc_bind_address": "127.0.0.1",
|
||||
...
|
||||
# If there are problems with other internet applications while bittorrent
|
||||
# is running, you may need to reduce the max upload speed to under 80% of
|
||||
# your ISP's max upload speed.
|
||||
"speed-limit-up": 100, # in kB/s
|
||||
"speed-limit-up-enabled": true,
|
||||
"speed_limit_up": 100, # in kB/s
|
||||
"speed_limit_up_enabled": true,
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
@@ -1,45 +1,44 @@
|
||||
Transmission keeps working information on each torrent in a "resume" file. This file is stored in the 'resume' directory.
|
||||
|
||||
Filename: `<torrent file name>.<hash?>.resume`
|
||||
Filename: `<hash?>.resume`
|
||||
|
||||
The file contains the following **per-torrent** properties:
|
||||
<table>
|
||||
<tr><th>Property</th><th>Description</th></tr>
|
||||
<tr><td><tt>activity-date</tt></td><td>Date we last uploaded/downloaded a piece of data</td></tr>
|
||||
<tr><td><tt>added-date</tt></td><td>Date torrent was added</td></tr>
|
||||
<tr><td><tt>corrupt</tt></td><td>total number of corrupt bytes downloaded</td></tr>
|
||||
<tr><td><tt>done-date</tt></td><td>Date torrent finished downloading</td></tr>
|
||||
<tr><td><tt>destination</tt></td><td>Download directory</td></tr>
|
||||
<tr><td><tt>dnd</tt></td><td>Do not download file integer list (one item per file in torrent) 0=download, 1=dnd</td></tr>
|
||||
<tr><td><tt>downloaded</tt></td><td>Total non-corrupt bytes downloaded</td></tr>
|
||||
<tr><td><tt>incomplete-dir</tt></td><td>Location of incomplete torrent files</td></tr>
|
||||
<tr><td><tt>max-peers</tt></td><td>Maximum number of connected peers</td></tr>
|
||||
<tr><td><tt>paused</tt></td><td>true if torrent is paused</td></tr>
|
||||
<tr><td><tt>peers2</tt></td><td>IPv4 peers</td></tr>
|
||||
<tr><td><tt>peers2-6</tt></td><td>IPv6 peers</td></tr>
|
||||
<tr><td><tt>priority</tt></td><td>list of file download priorities (one item per file in torrent),<br/>each value is -1 (low), 0 (std), +1 (high)</td></tr>
|
||||
<tr><td><tt>bandwidth-priority</tt></td><td></td></tr>
|
||||
<tr><td><tt>progress</tt></td><td></td></tr>
|
||||
<tr><td><tt>speed-limit</tt></td><td></td></tr>
|
||||
<tr><td><tt>speed-limit-up</tt></td><td>Torrent upload speed limit</td></tr>
|
||||
<tr><td><tt>speed-limit-down</tt></td><td>Torrent download speed limit</td></tr>
|
||||
<tr><td><tt>ratio-limit</tt></td><td>Torrent file limit</td></tr>
|
||||
<tr><td><tt>uploaded</tt></td><td></td></tr>
|
||||
<tr><td><tt>speed</tt></td><td></td></tr>
|
||||
<tr><td><tt>use-global-speed-limit</tt></td><td></td></tr>
|
||||
<tr><td><tt>use-speed-limit</tt></td><td></td></tr>
|
||||
<tr><td><tt>down-speed</tt></td><td></td></tr>
|
||||
<tr><td><tt>down-mode</tt></td><td></td></tr>
|
||||
<tr><td><tt>up-speed</tt></td><td></td></tr>
|
||||
<tr><td><tt>up-mode</tt></td><td></td></tr>
|
||||
<tr><td><tt>ratio-mode</tt></td><td></td></tr>
|
||||
<tr><td><tt>mtimes</tt></td><td></td></tr>
|
||||
<tr><td><tt>bitfield</tt></td><td></td></tr>
|
||||
</table>
|
||||
|
||||
| Property | Description |
|
||||
| :-- | :-- |
|
||||
| `activity_date` | Date we last uploaded/downloaded a piece of data |
|
||||
| `added_date` | Date torrent was added |
|
||||
| `corrupt` | total number of corrupt bytes downloaded |
|
||||
| `done_date` | Date torrent finished downloading |
|
||||
| `destination` | Download directory |
|
||||
| `dnd` | Do not download file integer list (one item per file in torrent) 0=download, 1=dnd |
|
||||
| `downloaded` | Total non-corrupt bytes downloaded |
|
||||
| `incomplete_dir` | Location of incomplete torrent files |
|
||||
| `max_peers` | Maximum number of connected peers |
|
||||
| `paused` | true if torrent is paused |
|
||||
| `peers2` | IPv4 peers |
|
||||
| `peers2_6` | IPv6 peers |
|
||||
| `priority` | list of file download priorities (one item per file in torrent),<br/>each value is -1 (low), 0 (std), +1 (high) |
|
||||
| `bandwidth_priority` | |
|
||||
| `progress` | |
|
||||
| `speed-limit` | |
|
||||
| `speed_limit_up` | Torrent upload speed limit |
|
||||
| `speed_limit_down` | Torrent download speed limit |
|
||||
| `ratio_limit` | Torrent file limit |
|
||||
| `uploaded` | |
|
||||
| `speed` | |
|
||||
| `use_global_speed_limit` | |
|
||||
| `use_speed_limit` | |
|
||||
| `down-speed` | |
|
||||
| `down-mode` | |
|
||||
| `up-speed` | |
|
||||
| `up-mode` | |
|
||||
| `ratio_mode` | |
|
||||
| `mtimes` | |
|
||||
| `bitfield` | |
|
||||
|
||||
The file format is bencoding, as described in [bep_0003](https://www.bittorrent.org/beps/bep_0003.html).
|
||||
|
||||
## Constants
|
||||
<table>
|
||||
<tr><td>Maximum number of remembered peers</td><td><tt>MAX_REMEMBERED_PEERS</tt></td><td>200</td></tr>
|
||||
</table>
|
||||
|
||||
| Maximum number of remembered peers | `MAX_REMEMBERED_PEERS` | 200 |
|
||||
|
||||
632
docs/rpc-spec.md
632
docs/rpc-spec.md
@@ -1,9 +1,9 @@
|
||||
> [!IMPORTANT]
|
||||
> Transmisson 4.1.0 (`rpc-version` 18) added support for the JSON-RPC 2.0 protocol.
|
||||
> Transmisson 4.1.0 (`rpc_version` 18) added support for the JSON-RPC 2.0 protocol and converted all RPC strings to snake_case.
|
||||
>
|
||||
> The old bespoke RPC protocol is still supported in Transmission 4 but is deprecated and will be removed in the future. People using the old protocol should update their code!
|
||||
> The old bespoke RPC protocol, and the old mix of kebab-case and camelCase strings, are still supported in Transmission 4 but are deprecated and will be removed in the future. People using the old protocol should update their code!
|
||||
>
|
||||
> For documentation of the old RPC protocol, please consult documentation from previous versions.
|
||||
> For documentation of the old RPC protocol and strings, please consult documentation from previous versions.
|
||||
> https://github.com/transmission/transmission/blob/4.0.6/docs/rpc-spec.md
|
||||
|
||||
# Transmission's RPC specification
|
||||
@@ -44,7 +44,7 @@ Response parameters are returned in the `result` Object.
|
||||
"params": {
|
||||
"fields": [ "version" ]
|
||||
},
|
||||
"method": "session-get",
|
||||
"method": "session_get",
|
||||
"id": 912313
|
||||
}
|
||||
```
|
||||
@@ -121,7 +121,7 @@ content, `localhost` and `localhost.` domain names as well as all the IP
|
||||
addresses are always implicitly allowed.
|
||||
|
||||
For more information on configuration, see settings.json documentation for
|
||||
`rpc-host-whitelist-enabled` and `rpc-host-whitelist` keys.
|
||||
`rpc_host_whitelist_enabled` and `rpc_host_whitelist` keys.
|
||||
|
||||
#### 2.2.3 Authentication
|
||||
Enabling authentication is an optional security feature that can be enabled
|
||||
@@ -138,11 +138,11 @@ username and password (respectively), separated by a colon.
|
||||
### 3.1 Torrent action requests
|
||||
| Method name | libtransmission function | Description
|
||||
|:--|:--|:--
|
||||
| `torrent-start` | tr_torrentStart | start torrent
|
||||
| `torrent-start-now` | tr_torrentStartNow | start torrent disregarding queue position
|
||||
| `torrent-stop` | tr_torrentStop | stop torrent
|
||||
| `torrent-verify` | tr_torrentVerify | verify torrent
|
||||
| `torrent-reannounce` | tr_torrentManualUpdate | re-announce to trackers now
|
||||
| `torrent_start` | tr_torrentStart | start torrent
|
||||
| `torrent_start_now` | tr_torrentStartNow | start torrent disregarding queue position
|
||||
| `torrent_stop` | tr_torrentStop | stop torrent
|
||||
| `torrent_verify` | tr_torrentVerify | verify torrent
|
||||
| `torrent_reannounce` | tr_torrentManualUpdate | re-announce to trackers now
|
||||
|
||||
Request parameters: `ids`, which specifies which torrents to use.
|
||||
All torrents are used if the `ids` parameter is omitted.
|
||||
@@ -151,56 +151,56 @@ All torrents are used if the `ids` parameter is omitted.
|
||||
|
||||
1. an integer referring to a torrent id
|
||||
2. a list of torrent id numbers, SHA1 hash strings, or both
|
||||
3. a string, `recently-active`, for recently-active torrents
|
||||
3. a string, `recently_active`, for recently-active torrents
|
||||
|
||||
Note that integer torrent ids are not stable across Transmission daemon
|
||||
restarts. Use torrent hashes if you need stable ids.
|
||||
|
||||
Response parameters: none
|
||||
|
||||
### 3.2 Torrent mutator: `torrent-set`
|
||||
Method name: `torrent-set`
|
||||
### 3.2 Torrent mutator: `torrent_set`
|
||||
Method name: `torrent_set`
|
||||
|
||||
Request parameters:
|
||||
|
||||
| Key | Value Type | Value Description
|
||||
|:--|:--|:--
|
||||
| `bandwidthPriority` | number | this torrent's bandwidth tr_priority_t
|
||||
| `downloadLimit` | number | maximum download speed (kB/s)
|
||||
| `downloadLimited` | boolean | true if `downloadLimit` is honored
|
||||
| `files-unwanted` | array | indices of file(s) to not download
|
||||
| `files-wanted` | array | indices of file(s) to download
|
||||
| `bandwidth_priority` | number | this torrent's bandwidth tr_priority_t
|
||||
| `download_limit` | number | maximum download speed (kB/s)
|
||||
| `download_limited` | boolean | true if `download_limit` is honored
|
||||
| `files_unwanted` | array | indices of file(s) to not download
|
||||
| `files_wanted` | array | indices of file(s) to download
|
||||
| `group` | string | The name of this torrent's bandwidth group
|
||||
| `honorsSessionLimits` | boolean | true if session upload limits are honored
|
||||
| `honors_session_limits` | boolean | true if session upload limits are honored
|
||||
| `ids` | array | torrent list, as described in 3.1
|
||||
| `labels` | array | array of string labels
|
||||
| `location` | string | new location of the torrent's content
|
||||
| `peer-limit` | number | maximum number of peers
|
||||
| `priority-high` | array | indices of high-priority file(s)
|
||||
| `priority-low` | array | indices of low-priority file(s)
|
||||
| `priority-normal` | array | indices of normal-priority file(s)
|
||||
| `queuePosition` | number | position of this torrent in its queue [0...n)
|
||||
| `seedIdleLimit` | number | torrent-level number of minutes of seeding inactivity
|
||||
| `seedIdleMode` | number | which seeding inactivity to use. See tr_idlelimit
|
||||
| `seedRatioLimit` | double | torrent-level seeding ratio
|
||||
| `seedRatioMode` | number | which ratio to use. See tr_ratiolimit
|
||||
| `peer_limit` | number | maximum number of peers
|
||||
| `priority_high` | array | indices of high-priority file(s)
|
||||
| `priority_low` | array | indices of low-priority file(s)
|
||||
| `priority_normal` | array | indices of normal-priority file(s)
|
||||
| `queue_position` | number | position of this torrent in its queue [0...n)
|
||||
| `seed_idle_limit` | number | torrent-level number of minutes of seeding inactivity
|
||||
| `seed_idle_mode` | number | which seeding inactivity to use. See tr_idlelimit
|
||||
| `seed_ratio_limit` | double | torrent-level seeding ratio
|
||||
| `seed_ratio_mode` | number | which ratio to use. See tr_ratiolimit
|
||||
| `sequential_download` | boolean | download torrent pieces sequentially
|
||||
| `sequential_download_from_piece` | number | download from a specific piece when sequential download is enabled
|
||||
| `trackerAdd` | array | **DEPRECATED** use `trackerList` instead
|
||||
| `trackerList` | string | string of announce URLs, one per line, and a blank line between [tiers](https://www.bittorrent.org/beps/bep_0012.html).
|
||||
| `trackerRemove` | array | **DEPRECATED** use `trackerList` instead
|
||||
| `trackerReplace` | array | **DEPRECATED** use `trackerList` instead
|
||||
| `uploadLimit` | number | maximum upload speed (kB/s)
|
||||
| `uploadLimited` | boolean | true if `uploadLimit` is honored
|
||||
| `tracker_add` | array | **DEPRECATED** use `tracker_list` instead
|
||||
| `tracker_list` | string | string of announce URLs, one per line, and a blank line between [tiers](https://www.bittorrent.org/beps/bep_0012.html).
|
||||
| `tracker_remove` | array | **DEPRECATED** use `tracker_list` instead
|
||||
| `tracker_replace` | array | **DEPRECATED** use `tracker_list` instead
|
||||
| `upload_limit` | number | maximum upload speed (kB/s)
|
||||
| `upload_limited` | boolean | true if `upload_limit` is honored
|
||||
|
||||
Just as an empty `ids` value is shorthand for "all ids", using an empty array
|
||||
for `files-wanted`, `files-unwanted`, `priority-high`, `priority-low`, or
|
||||
`priority-normal` is shorthand for saying "all files".
|
||||
for `files_wanted`, `files_unwanted`, `priority_high`, `priority_low`, or
|
||||
`priority_normal` is shorthand for saying "all files".
|
||||
|
||||
Response parameters: none
|
||||
|
||||
### 3.3 Torrent accessor: `torrent-get`
|
||||
Method name: `torrent-get`.
|
||||
### 3.3 Torrent accessor: `torrent_get`
|
||||
Method name: `torrent_get`.
|
||||
|
||||
Request parameters:
|
||||
|
||||
@@ -225,7 +225,7 @@ Response parameters:
|
||||
a torrent's values for those keys. This format is more efficient
|
||||
in terms of JSON generation and JSON parsing.
|
||||
|
||||
2. If the request's `ids` field was `recently-active`,
|
||||
2. If the request's `ids` field was `recently_active`,
|
||||
a `removed` array of torrent-id numbers of recently-removed
|
||||
torrents.
|
||||
|
||||
@@ -235,95 +235,95 @@ The 'source' column here corresponds to the data structure there.
|
||||
|
||||
| Key | Value Type | transmission.h source
|
||||
|:--|:--|:--
|
||||
| `activityDate` | number | tr_stat
|
||||
| `addedDate` | number | tr_stat
|
||||
| `activity_date` | number | tr_stat
|
||||
| `added_date` | number | tr_stat
|
||||
| `availability` | array (see below)| tr_torrentAvailability()
|
||||
| `bandwidthPriority` | number | tr_priority_t
|
||||
| `bytesCompleted` | array (see below)| n/a
|
||||
| `bandwidth_priority` | number | tr_priority_t
|
||||
| `bytes_completed` | array (see below)| n/a
|
||||
| `comment` | string | tr_torrent_view
|
||||
| `corruptEver`| number | tr_stat
|
||||
| `corrupt_ever`| number | tr_stat
|
||||
| `creator`| string | tr_torrent_view
|
||||
| `dateCreated`| number| tr_torrent_view
|
||||
| `desiredAvailable`| number| tr_stat
|
||||
| `doneDate`| number | tr_stat
|
||||
| `downloadDir` | string | tr_torrent
|
||||
| `downloadedEver` | number | tr_stat
|
||||
| `downloadLimit` | number | tr_torrent
|
||||
| `downloadLimited` | boolean | tr_torrent
|
||||
| `editDate` | number | tr_stat
|
||||
| `date_created`| number| tr_torrent_view
|
||||
| `desired_available`| number| tr_stat
|
||||
| `done_date`| number | tr_stat
|
||||
| `download_dir` | string | tr_torrent
|
||||
| `downloaded_ever` | number | tr_stat
|
||||
| `download_limit` | number | tr_torrent
|
||||
| `download_limited` | boolean | tr_torrent
|
||||
| `edit_date` | number | tr_stat
|
||||
| `error` | number | tr_stat
|
||||
| `errorString` | string | tr_stat
|
||||
| `error_string` | string | tr_stat
|
||||
| `eta` | number | tr_stat
|
||||
| `etaIdle` | number | tr_stat
|
||||
| `file-count` | number | tr_info
|
||||
| `eta_idle` | number | tr_stat
|
||||
| `file_count` | number | tr_info
|
||||
| `files`| array (see below)| n/a
|
||||
| `fileStats`| array (see below)| n/a
|
||||
| `file_stats`| array (see below)| n/a
|
||||
| `group`| string| n/a
|
||||
| `hashString`| string| tr_torrent_view
|
||||
| `haveUnchecked`| number| tr_stat
|
||||
| `haveValid`| number| tr_stat
|
||||
| `honorsSessionLimits`| boolean| tr_torrent
|
||||
| `hash_string`| string| tr_torrent_view
|
||||
| `have_unchecked`| number| tr_stat
|
||||
| `have_valid`| number| tr_stat
|
||||
| `honors_session_limits`| boolean| tr_torrent
|
||||
| `id` | number | tr_torrent
|
||||
| `isFinished` | boolean| tr_stat
|
||||
| `isPrivate` | boolean| tr_torrent
|
||||
| `isStalled` | boolean| tr_stat
|
||||
| `is_finished` | boolean| tr_stat
|
||||
| `is_private` | boolean| tr_torrent
|
||||
| `is_stalled` | boolean| tr_stat
|
||||
| `labels` | array of strings | tr_torrent
|
||||
| `leftUntilDone` | number| tr_stat
|
||||
| `magnetLink` | string| n/a
|
||||
| `manualAnnounceTime` | number| **DEPRECATED** don't use it, it never worked
|
||||
| `maxConnectedPeers` | number| tr_torrent
|
||||
| `metadataPercentComplete` | double| tr_stat
|
||||
| `left_until_done` | number| tr_stat
|
||||
| `magnet_link` | string| n/a
|
||||
| `manual_announce_time` | number| **DEPRECATED** don't use it, it never worked
|
||||
| `max_connected_peers` | number| tr_torrent
|
||||
| `metadata_percent_complete` | double| tr_stat
|
||||
| `name` | string| tr_torrent_view
|
||||
| `peer-limit` | number| tr_torrent
|
||||
| `peer_limit` | number| tr_torrent
|
||||
| `peers` | array (see below)| n/a
|
||||
| `peersConnected` | number| tr_stat
|
||||
| `peersFrom` | object (see below)| n/a
|
||||
| `peersGettingFromUs` | number| tr_stat
|
||||
| `peersSendingToUs` | number| tr_stat
|
||||
| `percentComplete` | double | tr_stat
|
||||
| `percentDone` | double | tr_stat
|
||||
| `peers_connected` | number| tr_stat
|
||||
| `peers_from` | object (see below)| n/a
|
||||
| `peers_getting_from_us` | number| tr_stat
|
||||
| `peers_sending_to_us` | number| tr_stat
|
||||
| `percent_complete` | double | tr_stat
|
||||
| `percent_done` | double | tr_stat
|
||||
| `pieces` | string (see below)| tr_torrent
|
||||
| `pieceCount`| number| tr_torrent_view
|
||||
| `pieceSize`| number| tr_torrent_view
|
||||
| `piece_count`| number| tr_torrent_view
|
||||
| `piece_size`| number| tr_torrent_view
|
||||
| `priorities`| array (see below)| n/a
|
||||
| `primary-mime-type`| string| tr_torrent
|
||||
| `queuePosition`| number| tr_stat
|
||||
| `rateDownload` (B/s)| number| tr_stat
|
||||
| `rateUpload` (B/s)| number| tr_stat
|
||||
| `recheckProgress`| double| tr_stat
|
||||
| `secondsDownloading`| number| tr_stat
|
||||
| `secondsSeeding`| number| tr_stat
|
||||
| `seedIdleLimit`| number| tr_torrent
|
||||
| `seedIdleMode`| number| tr_inactivelimit
|
||||
| `seedRatioLimit`| double| tr_torrent
|
||||
| `seedRatioMode`| number| tr_ratiolimit
|
||||
| `primary_mime_type`| string| tr_torrent
|
||||
| `queue_position`| number| tr_stat
|
||||
| `rate_download` (B/s)| number| tr_stat
|
||||
| `rate_upload` (B/s)| number| tr_stat
|
||||
| `recheck_progress`| double| tr_stat
|
||||
| `seconds_downloading`| number| tr_stat
|
||||
| `seconds_seeding`| number| tr_stat
|
||||
| `seed_idle_limit`| number| tr_torrent
|
||||
| `seed_idle_mode`| number| tr_inactivelimit
|
||||
| `seed_ratio_limit`| double| tr_torrent
|
||||
| `seed_ratio_mode`| number| tr_ratiolimit
|
||||
| `sequential_download`| boolean| tr_torrent
|
||||
| `sequential_download_from_piece`| number| tr_torrent
|
||||
| `sizeWhenDone`| number| tr_stat
|
||||
| `startDate`| number| tr_stat
|
||||
| `size_when_done`| number| tr_stat
|
||||
| `start_date`| number| tr_stat
|
||||
| `status`| number (see below)| tr_stat
|
||||
| `torrent_file`| string| tr_info
|
||||
| `total_size`| number| tr_torrent_view
|
||||
| `trackers`| array (see below)| n/a
|
||||
| `trackerList` | string | string of announce URLs, one per line, with a blank line between tiers
|
||||
| `trackerStats`| array (see below)| n/a
|
||||
| `totalSize`| number| tr_torrent_view
|
||||
| `torrentFile`| string| tr_info
|
||||
| `uploadedEver`| number| tr_stat
|
||||
| `uploadLimit`| number| tr_torrent
|
||||
| `uploadLimited`| boolean| tr_torrent
|
||||
| `uploadRatio`| double| tr_stat
|
||||
| `tracker_list` | string | string of announce URLs, one per line, with a blank line between tiers
|
||||
| `tracker_stats`| array (see below)| n/a
|
||||
| `uploaded_ever`| number| tr_stat
|
||||
| `upload_limit`| number| tr_torrent
|
||||
| `upload_limited`| boolean| tr_torrent
|
||||
| `upload_ratio`| double| tr_stat
|
||||
| `wanted`| array (see below)| n/a
|
||||
| `webseeds`| array of strings | tr_tracker_view
|
||||
| `webseedsSendingToUs`| number| tr_stat
|
||||
| `webseeds_sending_to_us`| number| tr_stat
|
||||
|
||||
`availability`: An array of `pieceCount` numbers representing the number of connected peers that have each piece, or -1 if we already have the piece ourselves.
|
||||
`availability`: An array of `piece_count` numbers representing the number of connected peers that have each piece, or -1 if we already have the piece ourselves.
|
||||
|
||||
`bytesCompleted`: An array of `tr_info.filecount` numbers. Each is the completed bytes for the corresponding file.
|
||||
`bytes_completed`: An array of `tr_info.filecount` numbers. Each is the completed bytes for the corresponding file.
|
||||
|
||||
`files`: array of objects, each containing:
|
||||
|
||||
| Key | Value Type | transmission.h source
|
||||
|:--|:--|:--
|
||||
| `bytesCompleted` | number | tr_file_view
|
||||
| `bytes_completed` | number | tr_file_view
|
||||
| `length` | number | tr_file_view
|
||||
| `name` | string | tr_file_view
|
||||
| `begin_piece` | number | tr_file_view
|
||||
@@ -331,52 +331,52 @@ The 'source' column here corresponds to the data structure there.
|
||||
|
||||
Files are returned in the order they are laid out in the torrent. References to "file indices" throughout this specification should be interpreted as the position of the file within this ordering, with the first file bearing index 0.
|
||||
|
||||
`fileStats`: a file's non-constant properties. An array of `tr_info.filecount` objects, in the same order as `files`, each containing:
|
||||
`file_stats`: a file's non-constant properties. An array of `tr_info.filecount` objects, in the same order as `files`, each containing:
|
||||
|
||||
| Key | Value Type | transmission.h source
|
||||
|:--|:--|:--
|
||||
| `bytesCompleted` | number | tr_file_view
|
||||
| `wanted` | boolean | tr_file_view (**Note:** Not to be confused with `torrent-get.wanted`, which is an array of 0/1 instead of boolean)
|
||||
| `bytes_completed` | number | tr_file_view
|
||||
| `wanted` | boolean | tr_file_view (**Note:** Not to be confused with `torrent_get.wanted`, which is an array of 0/1 instead of boolean)
|
||||
| `priority` | number | tr_file_view
|
||||
|
||||
`peers`: an array of objects, each containing:
|
||||
|
||||
| Key | Value Type | transmission.h source
|
||||
|:--|:--|:--
|
||||
| `address` | string | tr_peer_stat
|
||||
| `bytes_to_client` | number | tr_peer_stat
|
||||
| `bytes_to_peer` | number | tr_peer_stat
|
||||
| `clientName` | string | tr_peer_stat
|
||||
| `clientIsChoked` | boolean | tr_peer_stat
|
||||
| `clientIsInterested` | boolean | tr_peer_stat
|
||||
| `flagStr` | string | tr_peer_stat
|
||||
| `isDownloadingFrom` | boolean | tr_peer_stat
|
||||
| `isEncrypted` | boolean | tr_peer_stat
|
||||
| `isIncoming` | boolean | tr_peer_stat
|
||||
| `isUploadingTo` | boolean | tr_peer_stat
|
||||
| `isUTP` | boolean | tr_peer_stat
|
||||
| `peerIsChoked` | boolean | tr_peer_stat
|
||||
| `peerIsInterested` | boolean | tr_peer_stat
|
||||
| `peer_id` | string | tr_peer_stat
|
||||
| `port` | number | tr_peer_stat
|
||||
| `progress` | double | tr_peer_stat
|
||||
| `rateToClient` (B/s) | number | tr_peer_stat
|
||||
| `rateToPeer` (B/s) | number | tr_peer_stat
|
||||
| `address` | string | tr_peer_stat
|
||||
| `bytes_to_client` | number | tr_peer_stat
|
||||
| `bytes_to_peer` | number | tr_peer_stat
|
||||
| `client_is_choked` | boolean | tr_peer_stat
|
||||
| `client_is_interested` | boolean | tr_peer_stat
|
||||
| `client_name` | string | tr_peer_stat
|
||||
| `flag_str` | string | tr_peer_stat
|
||||
| `is_downloading_from` | boolean | tr_peer_stat
|
||||
| `is_encrypted` | boolean | tr_peer_stat
|
||||
| `is_incoming` | boolean | tr_peer_stat
|
||||
| `is_uploading_to` | boolean | tr_peer_stat
|
||||
| `is_utp` | boolean | tr_peer_stat
|
||||
| `peer_id` | string | tr_peer_stat
|
||||
| `peer_is_choked` | boolean | tr_peer_stat
|
||||
| `peer_is_interested` | boolean | tr_peer_stat
|
||||
| `port` | number | tr_peer_stat
|
||||
| `progress` | double | tr_peer_stat
|
||||
| `rate_to_client` (B/s) | number | tr_peer_stat
|
||||
| `rate_to_peer` (B/s) | number | tr_peer_stat
|
||||
|
||||
`peersFrom`: an object containing:
|
||||
`peers_from`: an object containing:
|
||||
|
||||
| Key | Value Type | transmission.h source
|
||||
|:--|:--|:--
|
||||
| `fromCache` | number | tr_stat
|
||||
| `fromDht` | number | tr_stat
|
||||
| `fromIncoming` | number | tr_stat
|
||||
| `fromLpd` | number | tr_stat
|
||||
| `fromLtep` | number | tr_stat
|
||||
| `fromPex` | number | tr_stat
|
||||
| `fromTracker` | number | tr_stat
|
||||
| `from_cache` | number | tr_stat
|
||||
| `from_dht` | number | tr_stat
|
||||
| `from_incoming` | number | tr_stat
|
||||
| `from_lpd` | number | tr_stat
|
||||
| `from_ltep` | number | tr_stat
|
||||
| `from_pex` | number | tr_stat
|
||||
| `from_tracker` | number | tr_stat
|
||||
|
||||
|
||||
`pieces`: A bitfield holding pieceCount flags which are set to 'true' if we have the piece matching that position. JSON doesn't allow raw binary data, so this is a base64-encoded string. (Source: tr_torrent)
|
||||
`pieces`: A bitfield holding `piece_count` flags which are set to 'true' if we have the piece matching that position. JSON doesn't allow raw binary data, so this is a base64-encoded string. (Source: tr_torrent)
|
||||
|
||||
`priorities`: An array of `tr_torrentFileCount()` numbers. Each is the `tr_priority_t` mode for the corresponding file.
|
||||
|
||||
@@ -403,38 +403,38 @@ Files are returned in the order they are laid out in the torrent. References to
|
||||
| `sitename` | string | tr_tracker_view
|
||||
| `tier` | number | tr_tracker_view
|
||||
|
||||
`trackerStats`: array of objects, each containing:
|
||||
`tracker_stats`: array of objects, each containing:
|
||||
|
||||
| Key | Value Type | transmission.h source
|
||||
|:--|:--|:--
|
||||
| `announce` | string | tr_tracker_view
|
||||
| `announceState` | number | tr_tracker_view
|
||||
| `downloadCount` | number | tr_tracker_view
|
||||
| `downloader_count` | number | tr_tracker_view
|
||||
| `hasAnnounced` | boolean | tr_tracker_view
|
||||
| `hasScraped` | boolean | tr_tracker_view
|
||||
| `host` | string | tr_tracker_view
|
||||
| `id` | number | tr_tracker_view
|
||||
| `isBackup` | boolean | tr_tracker_view
|
||||
| `lastAnnouncePeerCount` | number | tr_tracker_view
|
||||
| `lastAnnounceResult` | string | tr_tracker_view
|
||||
| `lastAnnounceStartTime` | number | tr_tracker_view
|
||||
| `lastAnnounceSucceeded` | boolean | tr_tracker_view
|
||||
| `lastAnnounceTime` | number | tr_tracker_view
|
||||
| `lastAnnounceTimedOut` | boolean | tr_tracker_view
|
||||
| `lastScrapeResult` | string | tr_tracker_view
|
||||
| `lastScrapeStartTime` | number | tr_tracker_view
|
||||
| `lastScrapeSucceeded` | boolean | tr_tracker_view
|
||||
| `lastScrapeTime` | number | tr_tracker_view
|
||||
| `lastScrapeTimedOut` | boolean | tr_tracker_view
|
||||
| `leecherCount` | number | tr_tracker_view
|
||||
| `nextAnnounceTime` | number | tr_tracker_view
|
||||
| `nextScrapeTime` | number | tr_tracker_view
|
||||
| `scrape` | string | tr_tracker_view
|
||||
| `scrapeState` | number | tr_tracker_view
|
||||
| `seederCount` | number | tr_tracker_view
|
||||
| `sitename` | string | tr_tracker_view
|
||||
| `tier` | number | tr_tracker_view
|
||||
| `announce` | string | tr_tracker_view
|
||||
| `announce_state` | number | tr_tracker_view
|
||||
| `download_count` | number | tr_tracker_view
|
||||
| `downloader_count` | number | tr_tracker_view
|
||||
| `has_announced` | boolean | tr_tracker_view
|
||||
| `has_scraped` | boolean | tr_tracker_view
|
||||
| `host` | string | tr_tracker_view
|
||||
| `id` | number | tr_tracker_view
|
||||
| `is_backup` | boolean | tr_tracker_view
|
||||
| `last_announce_peer_count` | number | tr_tracker_view
|
||||
| `last_announce_result` | string | tr_tracker_view
|
||||
| `last_announce_start_time` | number | tr_tracker_view
|
||||
| `last_announce_succeeded` | boolean | tr_tracker_view
|
||||
| `last_announce_time` | number | tr_tracker_view
|
||||
| `last_announce_timed_out` | boolean | tr_tracker_view
|
||||
| `last_scrape_result` | string | tr_tracker_view
|
||||
| `last_scrape_start_time` | number | tr_tracker_view
|
||||
| `last_scrape_succeeded` | boolean | tr_tracker_view
|
||||
| `last_scrape_time` | number | tr_tracker_view
|
||||
| `last_scrape_timed_out` | boolean | tr_tracker_view
|
||||
| `leecher_count` | number | tr_tracker_view
|
||||
| `next_announce_time` | number | tr_tracker_view
|
||||
| `next_scrape_time` | number | tr_tracker_view
|
||||
| `scrape` | string | tr_tracker_view
|
||||
| `scrape_state` | number | tr_tracker_view
|
||||
| `seeder_count` | number | tr_tracker_view
|
||||
| `sitename` | string | tr_tracker_view
|
||||
| `tier` | number | tr_tracker_view
|
||||
|
||||
|
||||
`wanted`: An array of `tr_torrentFileCount()` 0/1, 1 (true) if the corresponding file is to be downloaded. (Source: `tr_file_view`)
|
||||
@@ -452,10 +452,10 @@ Request:
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"params": {
|
||||
"fields": [ "id", "name", "totalSize" ],
|
||||
"fields": [ "id", "name", "total_size" ],
|
||||
"ids": [ 7, 10 ]
|
||||
},
|
||||
"method": "torrent-get",
|
||||
"method": "torrent_get",
|
||||
"id": 39693
|
||||
}
|
||||
```
|
||||
@@ -470,12 +470,12 @@ Response:
|
||||
{
|
||||
"id": 10,
|
||||
"name": "Fedora x86_64 DVD",
|
||||
"totalSize": 34983493932
|
||||
"total_size": 34983493932
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"name": "Ubuntu x86_64 DVD",
|
||||
"totalSize": 9923890123
|
||||
"total_size": 9923890123
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -484,25 +484,25 @@ Response:
|
||||
```
|
||||
|
||||
### 3.4 Adding a torrent
|
||||
Method name: `torrent-add`
|
||||
Method name: `torrent_add`
|
||||
|
||||
Request parameters:
|
||||
|
||||
| Key | Value Type | Description
|
||||
|:--|:--|:--
|
||||
| `cookies` | string | pointer to a string of one or more cookies.
|
||||
| `download-dir` | string | path to download the torrent to
|
||||
| `download_dir` | string | path to download the torrent to
|
||||
| `filename` | string | filename or URL of the .torrent file
|
||||
| `labels` | array | array of string labels
|
||||
| `metainfo` | string | base64-encoded .torrent content
|
||||
| `paused` | boolean | if true, don't start the torrent
|
||||
| `peer-limit` | number | maximum number of peers
|
||||
| `bandwidthPriority` | number | torrent's bandwidth tr_priority_t
|
||||
| `files-wanted` | array | indices of file(s) to download
|
||||
| `files-unwanted` | array | indices of file(s) to not download
|
||||
| `priority-high` | array | indices of high-priority file(s)
|
||||
| `priority-low` | array | indices of low-priority file(s)
|
||||
| `priority-normal` | array | indices of normal-priority file(s)
|
||||
| `peer_limit` | number | maximum number of peers
|
||||
| `bandwidth_priority` | number | torrent's bandwidth tr_priority_t
|
||||
| `files_wanted` | array | indices of file(s) to download
|
||||
| `files_unwanted` | array | indices of file(s) to not download
|
||||
| `priority_high` | array | indices of high-priority file(s)
|
||||
| `priority_low` | array | indices of low-priority file(s)
|
||||
| `priority_normal` | array | indices of normal-priority file(s)
|
||||
| `sequential_download` | boolean | download torrent pieces sequentially
|
||||
| `sequential_download_from_piece` | number | download from a specific piece when sequential download is enabled
|
||||
|
||||
@@ -512,22 +512,22 @@ The format of the `cookies` should be `NAME=CONTENTS`, where `NAME` is the cooki
|
||||
|
||||
Response parameters:
|
||||
|
||||
* On success, a `torrent-added` object in the form of one of 3.3's torrent objects with the fields for `id`, `name`, and `hashString`.
|
||||
* On success, a `torrent_added` object in the form of one of 3.3's torrent objects with the fields for `id`, `name`, and `hash_string`.
|
||||
|
||||
* When attempting to add a duplicate torrent, a `torrent-duplicate` object in the same form is returned, but the response's `result` value is still `success`.
|
||||
* When attempting to add a duplicate torrent, a `torrent_duplicate` object in the same form is returned, but the response's `result` value is still `success`.
|
||||
|
||||
### 3.5 Removing a torrent
|
||||
Method name: `torrent-remove`
|
||||
Method name: `torrent_remove`
|
||||
|
||||
| Key | Value Type | Description
|
||||
|:--|:--|:--
|
||||
| `ids` | array | torrent list, as described in 3.1
|
||||
| `delete-local-data` | boolean | delete local data. (default: false)
|
||||
| `delete_local_data` | boolean | delete local data. (default: false)
|
||||
|
||||
Response parameters: none
|
||||
|
||||
### 3.6 Moving a torrent
|
||||
Method name: `torrent-set-location`
|
||||
Method name: `torrent_set_location`
|
||||
|
||||
Request parameters:
|
||||
|
||||
@@ -535,17 +535,17 @@ Request parameters:
|
||||
|:--|:--|:--
|
||||
| `ids` | array | torrent list, as described in 3.1
|
||||
| `location` | string | the new torrent location
|
||||
| `move` | boolean | if true, move from previous location. otherwise, search "location" for files (default: false)
|
||||
| `move` | boolean | if true, move from previous location. otherwise, search `location` for files (default: false)
|
||||
|
||||
Response parameters: none
|
||||
|
||||
### 3.7 Renaming a torrent's path
|
||||
Method name: `torrent-rename-path`
|
||||
Method name: `torrent_rename_path`
|
||||
|
||||
For more information on the use of this function, see the transmission.h
|
||||
documentation of `tr_torrentRenamePath()`. In particular, note that if this
|
||||
call succeeds you'll want to update the torrent's `files` and `name` field
|
||||
with `torrent-get`.
|
||||
with `torrent_get`.
|
||||
|
||||
Request parameters:
|
||||
|
||||
@@ -561,64 +561,66 @@ Response parameters: `path`, `name`, and `id`, holding the torrent ID integer
|
||||
### 4.1 Session parameters
|
||||
| Key | Value Type | Description
|
||||
|:--|:--|:--
|
||||
| `alt-speed-down` | number | max global download speed (kB/s)
|
||||
| `alt-speed-enabled` | boolean | true means use the alt speeds
|
||||
| `alt-speed-time-begin` | number | when to turn on alt speeds (units: minutes after midnight)
|
||||
| `alt-speed-time-day` | number | what day(s) to turn on alt speeds (look at tr_sched_day)
|
||||
| `alt-speed-time-enabled` | boolean | true means the scheduled on/off times are used
|
||||
| `alt-speed-time-end` | number | when to turn off alt speeds (units: same)
|
||||
| `alt-speed-up` | number | max global upload speed (kB/s)
|
||||
| `blocklist-enabled` | boolean | true means enabled
|
||||
| `blocklist-size` | number | number of rules in the blocklist
|
||||
| `blocklist-url` | string | location of the blocklist to use for `blocklist-update`
|
||||
| `cache-size-mb` | number | maximum size of the disk cache (MiB). Pieces are guaranteed to be written to filesystem if sequential download is enabled. Otherwise, data might still be in cache only.
|
||||
| `config-dir` | string | location of transmission's configuration directory
|
||||
| `default-trackers` | string | announce URLs, one per line, and a blank line between [tiers](https://www.bittorrent.org/beps/bep_0012.html).
|
||||
| `dht-enabled` | boolean | true means allow DHT in public torrents
|
||||
| `download-dir` | string | default path to download torrents
|
||||
| `download-dir-free-space` | number | **DEPRECATED** Use the `free-space` method instead.
|
||||
| `download-queue-enabled` | boolean | if true, limit how many torrents can be downloaded at once
|
||||
| `download-queue-size` | number | max number of torrents to download at once (see download-queue-enabled)
|
||||
| `alt_speed_down` | number | max global download speed (kB/s)
|
||||
| `alt_speed_enabled` | boolean | true means use the alt speeds
|
||||
| `alt_speed_time_begin` | number | when to turn on alt speeds (units: minutes after midnight)
|
||||
| `alt_speed_time_day` | number | what day(s) to turn on alt speeds (look at tr_sched_day)
|
||||
| `alt_speed_time_enabled` | boolean | true means the scheduled on/off times are used
|
||||
| `alt_speed_time_end` | number | when to turn off alt speeds (units: same)
|
||||
| `alt_speed_up` | number | max global upload speed (kB/s)
|
||||
| `anti_brute_force_enabled` | boolean | true means to enable a basic brute force protection for RPC server
|
||||
| `blocklist_enabled` | boolean | true means enabled
|
||||
| `blocklist_size` | number | number of rules in the blocklist
|
||||
| `blocklist_url` | string | location of the blocklist to use for `blocklist_update`
|
||||
| `cache_size_mb` | number | maximum size of the disk cache (MiB). Pieces are guaranteed to be written to filesystem if sequential download is enabled. Otherwise, data might still be in cache only.
|
||||
| `config_dir` | string | location of transmission's configuration directory
|
||||
| `default_trackers` | string | announce URLs, one per line, and a blank line between [tiers](https://www.bittorrent.org/beps/bep_0012.html).
|
||||
| `dht_enabled` | boolean | true means allow DHT in public torrents
|
||||
| `download_dir` | string | default path to download torrents
|
||||
| `download_dir_free_space` | number | **DEPRECATED** Use the `free_space` method instead.
|
||||
| `download_queue_enabled` | boolean | if true, limit how many torrents can be downloaded at once
|
||||
| `download_queue_size` | number | max number of torrents to download at once (see `download_queue_enabled`)
|
||||
| `encryption` | string | `required`, `preferred`, `tolerated`
|
||||
| `idle-seeding-limit-enabled` | boolean | true if the seeding inactivity limit is honored by default
|
||||
| `idle-seeding-limit` | number | torrents we're seeding will be stopped if they're idle for this long
|
||||
| `incomplete-dir-enabled` | boolean | true means keep torrents in incomplete-dir until done
|
||||
| `incomplete-dir` | string | path for incomplete torrents, when enabled
|
||||
| `lpd-enabled` | boolean | true means allow Local Peer Discovery in public torrents
|
||||
| `peer-limit-global` | number | maximum global number of peers
|
||||
| `peer-limit-per-torrent` | number | maximum global number of peers
|
||||
| `peer-port-random-on-start` | boolean | true means pick a random peer port on launch
|
||||
| `peer-port` | number | port number
|
||||
| `pex-enabled` | boolean | true means allow PEX in public torrents
|
||||
| `port-forwarding-enabled` | boolean | true means ask upstream router to forward the configured peer port to transmission using UPnP or NAT-PMP
|
||||
| `idle_seeding_limit` | number | torrents we're seeding will be stopped if they're idle for this long
|
||||
| `idle_seeding_limit_enabled` | boolean | true if the seeding inactivity limit is honored by default
|
||||
| `incomplete_dir` | string | path for incomplete torrents, when enabled
|
||||
| `incomplete_dir_enabled` | boolean | true means keep torrents in `incomplete_dir` until done
|
||||
| `lpd_enabled` | boolean | true means allow Local Peer Discovery in public torrents
|
||||
| `peer_limit_global` | number | maximum global number of peers
|
||||
| `peer_limit_per_torrent` | number | maximum global number of peers
|
||||
| `peer_port_random_on_start` | boolean | true means pick a random peer port on launch
|
||||
| `peer_port` | number | port number
|
||||
| `pex_enabled` | boolean | true means allow PEX in public torrents
|
||||
| `port_forwarding_enabled` | boolean | true means ask upstream router to forward the configured peer port to transmission using UPnP or NAT-PMP
|
||||
| `preferred_transports` | string[] | preference of transport protocols, see `settings.json` for details
|
||||
| `queue-stalled-enabled` | boolean | whether or not to consider idle torrents as stalled
|
||||
| `queue-stalled-minutes` | number | torrents that are idle for N minuets aren't counted toward seed-queue-size or download-queue-size
|
||||
| `rename-partial-files` | boolean | true means append `.part` to incomplete files
|
||||
| `queue_stalled_enabled` | boolean | whether or not to consider idle torrents as stalled
|
||||
| `queue_stalled_minutes` | number | torrents that are idle for N minuets aren't counted toward `seed_queue_size` or `download_queue_size`
|
||||
| `rename_partial_files` | boolean | true means append `.part` to incomplete files
|
||||
| `reqq` | number | the number of outstanding block requests a peer is allowed to queue in the client
|
||||
| `rpc-version-minimum` | number | the minimum RPC API version supported
|
||||
| `rpc-version-semver` | string | the current RPC API version in a [semver](https://semver.org)-compatible string
|
||||
| `rpc-version` | number | the current RPC API version
|
||||
| `script-torrent-added-enabled` | boolean | whether or not to call the `added` script
|
||||
| `script-torrent-added-filename` | string | filename of the script to run
|
||||
| `script-torrent-done-enabled` | boolean | whether or not to call the `done` script
|
||||
| `script-torrent-done-filename` | string | filename of the script to run
|
||||
| `script-torrent-done-seeding-enabled` | boolean | whether or not to call the `seeding-done` script
|
||||
| `script-torrent-done-seeding-filename` | string | filename of the script to run
|
||||
| `seed-queue-enabled` | boolean | if true, limit how many torrents can be uploaded at once
|
||||
| `seed-queue-size` | number | max number of torrents to uploaded at once (see seed-queue-enabled)
|
||||
| `seedRatioLimit` | double | the default seed ratio for torrents to use
|
||||
| `seedRatioLimited` | boolean | true if seedRatioLimit is honored by default
|
||||
| `rpc_version_minimum` | number | the minimum RPC API version supported
|
||||
| `rpc_version_semver` | string | the current RPC API version in a [semver](https://semver.org)-compatible string
|
||||
| `rpc_version` | number | the current RPC API version
|
||||
| `script_torrent_added_enabled` | boolean | whether or not to call the `added` script
|
||||
| `script_torrent_added_filename` | string | filename of the script to run
|
||||
| `script_torrent_done_enabled` | boolean | whether or not to call the `done` script
|
||||
| `script_torrent_done_filename` | string | filename of the script to run
|
||||
| `script_torrent_done_seeding_enabled` | boolean | whether or not to call the `seeding_done` script
|
||||
| `script_torrent_done_seeding_filename` | string | filename of the script to run
|
||||
| `seed_queue_enabled` | boolean | if true, limit how many torrents can be uploaded at once
|
||||
| `seed_queue_size` | number | max number of torrents to uploaded at once (see `seed_queue_enabled`)
|
||||
| `seed_ratio_limit` | double | the default seed ratio for torrents to use
|
||||
| `seed_ratio_limited` | boolean | true if `seed_ratio_limit` is honored by default
|
||||
| `sequential_download` | boolean | true means sequential download is enabled by default for added torrents
|
||||
| `session-id` | string | the current `X-Transmission-Session-Id` value
|
||||
| `speed-limit-down-enabled` | boolean | true means enabled
|
||||
| `speed-limit-down` | number | max global download speed (kB/s)
|
||||
| `speed-limit-up-enabled` | boolean | true means enabled
|
||||
| `speed-limit-up` | number | max global upload speed (kB/s)
|
||||
| `start-added-torrents` | boolean | true means added torrents will be started right away
|
||||
| `trash-original-torrent-files` | boolean | true means the .torrent file of added torrents will be deleted
|
||||
| `session_id` | string | the current `X-Transmission-Session-Id` value
|
||||
| `speed_limit_down` | number | max global download speed (kB/s)
|
||||
| `speed_limit_down_enabled` | boolean | true means enabled
|
||||
| `speed_limit_up` | number | max global upload speed (kB/s)
|
||||
| `speed_limit_up_enabled` | boolean | true means enabled
|
||||
| `start_added_torrents` | boolean | true means added torrents will be started right away
|
||||
| `tcp_enabled` | boolean | true means allow TCP
|
||||
| `trash_original_torrent_files` | boolean | true means the .torrent file of added torrents will be deleted
|
||||
| `units` | object | see below
|
||||
| `utp-enabled` | boolean | **DEPRECATED** Use `preferred_transports` instead
|
||||
| `utp_enabled` | boolean | **DEPRECATED** Use `preferred_transports` instead
|
||||
| `version` | string | long version string `$version ($revision)`
|
||||
|
||||
|
||||
@@ -626,40 +628,41 @@ Response parameters: `path`, `name`, and `id`, holding the torrent ID integer
|
||||
|
||||
| Key | Value Type | transmission.h source
|
||||
|:--|:--|:--
|
||||
| `speed-units` | array | 4 strings: KB/s, MB/s, GB/s, TB/s
|
||||
| `speed-bytes` | number | number of bytes in a KB (1000 for kB; 1024 for KiB)
|
||||
| `size-units` | array | 4 strings: KB/s, MB/s, GB/s, TB/s
|
||||
| `size-bytes` | number | number of bytes in a KB (1000 for kB; 1024 for KiB)
|
||||
| `memory-units` | array | 4 strings: KB/s, MB/s, GB/s, TB/s
|
||||
| `memory-bytes` | number | number of bytes in a KB (1000 for kB; 1024 for KiB)
|
||||
| `speed_units` | array | 4 strings: KB/s, MB/s, GB/s, TB/s
|
||||
| `speed_bytes` | number | number of bytes in a KB (1000 for kB; 1024 for KiB)
|
||||
| `size_units` | array | 4 strings: KB/s, MB/s, GB/s, TB/s
|
||||
| `size_bytes` | number | number of bytes in a KB (1000 for kB; 1024 for KiB)
|
||||
| `memory_units` | array | 4 strings: KB/s, MB/s, GB/s, TB/s
|
||||
| `memory_bytes` | number | number of bytes in a KB (1000 for kB; 1024 for KiB)
|
||||
|
||||
`rpc-version` indicates the RPC interface version supported by the RPC server.
|
||||
`rpc_version` indicates the RPC interface version supported by the RPC server.
|
||||
It is incremented when a new version of Transmission changes the RPC interface.
|
||||
|
||||
`rpc-version-minimum` indicates the oldest API supported by the RPC server.
|
||||
`rpc_version_minimum` indicates the oldest API supported by the RPC server.
|
||||
It is changes when a new version of Transmission changes the RPC interface
|
||||
in a way that is not backwards compatible. There are no plans for this
|
||||
to be common behavior.
|
||||
|
||||
#### 4.1.1 Mutators
|
||||
Method name: `session-set`
|
||||
Method name: `session_set`
|
||||
|
||||
Request parameters: the mutable properties from 4.1's parameters, i.e. all of them
|
||||
except:
|
||||
|
||||
* `blocklist-size`
|
||||
* `config-dir`
|
||||
* `rpc-version-minimum`,
|
||||
* `rpc-version-semver`
|
||||
* `rpc-version`
|
||||
* `session-id`
|
||||
* `blocklist_size`
|
||||
* `config_dir`
|
||||
* `rpc_version_minimum`,
|
||||
* `rpc_version_semver`
|
||||
* `rpc_version`
|
||||
* `session_id`
|
||||
* `tcp_enabled`
|
||||
* `units`
|
||||
* `version`
|
||||
|
||||
Response parameters: none
|
||||
|
||||
#### 4.1.2 Accessors
|
||||
Method name: `session-get`
|
||||
Method name: `session_get`
|
||||
|
||||
Request parameters: an optional `fields` array of keys (see 4.1)
|
||||
|
||||
@@ -667,7 +670,7 @@ Response parameters: key/value pairs matching the request's `fields`
|
||||
parameter if present, or all supported fields (see 4.1) otherwise.
|
||||
|
||||
### 4.2 Session statistics
|
||||
Method name: `session-stats`
|
||||
Method name: `session_stats`
|
||||
|
||||
Request parameters: none
|
||||
|
||||
@@ -675,36 +678,36 @@ Response parameters:
|
||||
|
||||
| Key | Value Type | Description
|
||||
|:--|:--|:--
|
||||
| `activeTorrentCount` | number
|
||||
| `downloadSpeed` | number
|
||||
| `pausedTorrentCount` | number
|
||||
| `torrentCount` | number
|
||||
| `uploadSpeed` | number
|
||||
| `cumulative-stats` | stats object (see below)
|
||||
| `current-stats` | stats object (see below)
|
||||
| `active_torrent_count` | number
|
||||
| `download_speed` | number
|
||||
| `paused_torrent_count` | number
|
||||
| `torrent_count` | number
|
||||
| `upload_speed` | number
|
||||
| `cumulative_stats` | stats object (see below)
|
||||
| `current_stats` | stats object (see below)
|
||||
|
||||
A stats object contains:
|
||||
|
||||
| Key | Value Type | transmission.h source
|
||||
|:--|:--|:--
|
||||
| `uploadedBytes` | number | tr_session_stats
|
||||
| `downloadedBytes` | number | tr_session_stats
|
||||
| `filesAdded` | number | tr_session_stats
|
||||
| `sessionCount` | number | tr_session_stats
|
||||
| `secondsActive` | number | tr_session_stats
|
||||
| `uploaded_bytes` | number | tr_session_stats
|
||||
| `downloaded_bytes` | number | tr_session_stats
|
||||
| `files_added` | number | tr_session_stats
|
||||
| `seconds_active` | number | tr_session_stats
|
||||
| `session_count` | number | tr_session_stats
|
||||
|
||||
### 4.3 Blocklist
|
||||
Method name: `blocklist-update`
|
||||
Method name: `blocklist_update`
|
||||
|
||||
Request parameters: none
|
||||
|
||||
Response parameters: a number `blocklist-size`
|
||||
Response parameters: a number `blocklist_size`
|
||||
|
||||
### 4.4 Port checking
|
||||
This method tests to see if your incoming peer port is accessible
|
||||
from the outside world.
|
||||
|
||||
Method name: `port-test`
|
||||
Method name: `port_test`
|
||||
|
||||
Request parameters: an optional parameter `ip_protocol`.
|
||||
`ip_protocol` is a string specifying the IP protocol version to be used for the port test.
|
||||
@@ -717,13 +720,13 @@ Response parameters:
|
||||
|
||||
| Key | Value Type | Description
|
||||
| :-- | :-- | :--
|
||||
| `port-is-open` | boolean | true if port is open, false if port is closed
|
||||
| `port_is_open` | boolean | true if port is open, false if port is closed
|
||||
| `ip_protocol` | string | `ipv4` if the test was carried out on IPv4, `ipv6` if the test was carried out on IPv6, unset if it cannot be determined
|
||||
|
||||
### 4.5 Session shutdown
|
||||
This method tells the Transmission session to shut down.
|
||||
|
||||
Method name: `session-close`
|
||||
Method name: `session_close`
|
||||
|
||||
Request parameters: none
|
||||
|
||||
@@ -732,10 +735,10 @@ Response parameters: none
|
||||
### 4.6 Queue movement requests
|
||||
| Method name | transmission.h source
|
||||
|:--|:--
|
||||
| `queue-move-top` | tr_torrentQueueMoveTop()
|
||||
| `queue-move-up` | tr_torrentQueueMoveUp()
|
||||
| `queue-move-down` | tr_torrentQueueMoveDown()
|
||||
| `queue-move-bottom` | tr_torrentQueueMoveBottom()
|
||||
| `queue_move_top` | tr_torrentQueueMoveTop()
|
||||
| `queue_move_up` | tr_torrentQueueMoveUp()
|
||||
| `queue_move_down` | tr_torrentQueueMoveDown()
|
||||
| `queue_move_bottom` | tr_torrentQueueMoveBottom()
|
||||
|
||||
Request parameters:
|
||||
|
||||
@@ -749,7 +752,7 @@ Response parameters: none
|
||||
This method tests how much free space is available in a
|
||||
client-specified folder.
|
||||
|
||||
Method name: `free-space`
|
||||
Method name: `free_space`
|
||||
|
||||
Request parameters:
|
||||
|
||||
@@ -762,28 +765,28 @@ Response parameters:
|
||||
| Key | Value type | Description
|
||||
|:--|:--|:--
|
||||
| `path` | string | same as the Request parameter
|
||||
| `size-bytes` | number | the size, in bytes, of the free space in that directory
|
||||
| `size_bytes` | number | the size, in bytes, of the free space in that directory
|
||||
| `total_size` | number | the total capacity, in bytes, of that directory
|
||||
|
||||
### 4.8 Bandwidth groups
|
||||
#### 4.8.1 Bandwidth group mutator: `group-set`
|
||||
Method name: `group-set`
|
||||
#### 4.8.1 Bandwidth group mutator: `group_set`
|
||||
Method name: `group_set`
|
||||
|
||||
Request parameters:
|
||||
|
||||
| Key | Value type | Description
|
||||
|:--|:--|:--
|
||||
| `honorsSessionLimits` | boolean | true if session upload limits are honored
|
||||
| `honors_session_limits` | boolean | true if session upload limits are honored
|
||||
| `name` | string | Bandwidth group name
|
||||
| `speed-limit-down-enabled` | boolean | true means enabled
|
||||
| `speed-limit-down` | number | max global download speed (kB/s)
|
||||
| `speed-limit-up-enabled` | boolean | true means enabled
|
||||
| `speed-limit-up` | number | max global upload speed (kB/s)
|
||||
| `speed_limit_down` | number | max global download speed (kB/s)
|
||||
| `speed_limit_down_enabled` | boolean | true means enabled
|
||||
| `speed_limit_up` | number | max global upload speed (kB/s)
|
||||
| `speed_limit_up_enabled` | boolean | true means enabled
|
||||
|
||||
Response parameters: none
|
||||
|
||||
#### 4.8.2 Bandwidth group accessor: `group-get`
|
||||
Method name: `group-get`
|
||||
#### 4.8.2 Bandwidth group accessor: `group_get`
|
||||
Method name: `group_get`
|
||||
|
||||
Request parameters: An optional parameter `group`.
|
||||
`group` is either a string naming the bandwidth group,
|
||||
@@ -800,27 +803,27 @@ A bandwidth group description object has:
|
||||
|
||||
| Key | Value type | Description
|
||||
|:--|:--|:--
|
||||
| `honorsSessionLimits` | boolean | true if session upload limits are honored
|
||||
| `honors_session_limits` | boolean | true if session upload limits are honored
|
||||
| `name` | string | Bandwidth group name
|
||||
| `speed-limit-down-enabled` | boolean | true means enabled
|
||||
| `speed-limit-down` | number | max global download speed (kB/s)
|
||||
| `speed-limit-up-enabled` | boolean | true means enabled
|
||||
| `speed-limit-up` | number | max global upload speed (kB/s)
|
||||
| `speed_limit_down` | number | max global download speed (kB/s)
|
||||
| `speed_limit_down_enabled` | boolean | true means enabled
|
||||
| `speed_limit_up` | number | max global upload speed (kB/s)
|
||||
| `speed_limit_up_enabled` | boolean | true means enabled
|
||||
|
||||
## 5 Protocol versions
|
||||
This section lists the changes that have been made to the RPC protocol.
|
||||
|
||||
There are two ways to check for API compatibility. Since most developers know
|
||||
[semver](https://semver.org/), session-get's `rpc-version-semver` is the
|
||||
[semver](https://semver.org/), `session_get`'s `rpc_version_semver` is the
|
||||
recommended way. That value is a semver-compatible string of the RPC protocol
|
||||
version number.
|
||||
|
||||
Since Transmission predates the semver 1.0 spec, the previous scheme was for
|
||||
the RPC version to be a whole number and to increment it whenever a change was
|
||||
made. That is session-get's `rpc-version`. `rpc-version-minimum` lists the
|
||||
made. That is `session_get`'s `rpc_version`. `rpc_version_minimum` lists the
|
||||
oldest version that is compatible with the current version; i.e. an app coded
|
||||
to use `rpc-version-minimum` would still work on a Transmission release running
|
||||
`rpc-version`.
|
||||
to use `rpc_version_minimum` would still work on a Transmission release running
|
||||
`rpc_version`.
|
||||
|
||||
Breaking changes are denoted with a :bomb: emoji.
|
||||
|
||||
@@ -902,7 +905,7 @@ Transmission 1.70 (`rpc-version-semver` 2.1.0, `rpc-version`: 6)
|
||||
|
||||
| Method | Description
|
||||
|:---|:---
|
||||
| `method torrent-set-location` | new method
|
||||
| method `torrent-set-location` | new method
|
||||
|
||||
Transmission 1.80 (`rpc-version-semver` 3.0.0, `rpc-version`: 7)
|
||||
|
||||
@@ -1005,7 +1008,7 @@ Transmission 2.40 (`rpc-version-semver` 5.0.0, `rpc-version`: 14)
|
||||
| `session-set` | new arg `queue-stalled-minutes`
|
||||
| `session-set` | new arg `seed-queue-enabled`
|
||||
| `session-set` | new arg `seed-queue-size`
|
||||
| `torrent-get` | new arg `fromLpd` in peersFrom
|
||||
| `torrent-get` | new arg `fromLpd` in `peersFrom`
|
||||
| `torrent-get` | new arg `isStalled`
|
||||
| `torrent-get` | new arg `queuePosition`
|
||||
| `torrent-set` | new arg `queuePosition`
|
||||
@@ -1062,26 +1065,27 @@ Transmission 4.0.0 (`rpc-version-semver` 5.3.0, `rpc-version`: 17)
|
||||
| `group-get` | new method
|
||||
| `torrent-get` | :warning: old arg `wanted` was implemented as an array of `0` or `1` in Transmission 3.00 and older, despite being documented as an array of booleans. Transmission 4.0.0 and 4.0.1 "fixed" this by returning an array of booleans; but in practical terms, this change caused an unannounced breaking change for any 3rd party code that expected `0` or `1`. For this reason, 4.0.2 restored the 3.00 behavior and updated this spec to match the code.
|
||||
|
||||
Transmission 4.1.0 (`rpc-version-semver` 6.0.0, `rpc-version`: 18)
|
||||
Transmission 4.1.0 (`rpc_version_semver` 6.0.0, `rpc_version`: 18)
|
||||
|
||||
:bomb: switch to the JSON-RPC 2.0 protocol
|
||||
:bomb: switch to snake_case for all strings
|
||||
|
||||
| Method | Description
|
||||
|:---|:---
|
||||
| `session-get` | new arg `sequential_download`
|
||||
| `session-set` | new arg `sequential_download`
|
||||
| `torrent-add` | new arg `sequential_download`
|
||||
| `torrent-get` | new arg `sequential_download`
|
||||
| `torrent-set` | new arg `sequential_download`
|
||||
| `torrent-add` | new arg `sequential_download_from_piece`
|
||||
| `torrent-get` | new arg `sequential_download_from_piece`
|
||||
| `torrent-set` | new arg `sequential_download_from_piece`
|
||||
| `torrent-get` | new arg `files.begin_piece`
|
||||
| `torrent-get` | new arg `files.end_piece`
|
||||
| `port-test` | new arg `ip_protocol`
|
||||
| `torrent-get` | new arg `trackerStats.downloader_count`
|
||||
| `torrent-get` | :warning: **DEPRECATED** `manualAnnounceTime`, it never worked
|
||||
| `session-get` | new arg `preferred_transports`
|
||||
| `session-set` | new arg `preferred_transports`
|
||||
| `session-get` | :warning: **DEPRECATED** `utp-enabled`. Use `preferred_transports` instead.
|
||||
| `session-set` | :warning: **DEPRECATED** `utp-enabled`. Use `preferred_transports` instead.
|
||||
| `session_get` | new arg `sequential_download`
|
||||
| `session_set` | new arg `sequential_download`
|
||||
| `torrent_add` | new arg `sequential_download`
|
||||
| `torrent_get` | new arg `sequential_download`
|
||||
| `torrent_set` | new arg `sequential_download`
|
||||
| `torrent_add` | new arg `sequential_download_from_piece`
|
||||
| `torrent_get` | new arg `sequential_download_from_piece`
|
||||
| `torrent_set` | new arg `sequential_download_from_piece`
|
||||
| `torrent_get` | new arg `files.begin_piece`
|
||||
| `torrent_get` | new arg `files.end_piece`
|
||||
| `port_test` | new arg `ip_protocol`
|
||||
| `torrent_get` | new arg `trackerStats.downloader_count`
|
||||
| `torrent_get` | :warning: **DEPRECATED** `manual_announce_time`, it never worked
|
||||
| `session_get` | new arg `preferred_transports`
|
||||
| `session_set` | new arg `preferred_transports`
|
||||
| `session_get` | :warning: **DEPRECATED** `utp_enabled`. Use `preferred_transports` instead.
|
||||
| `session_set` | :warning: **DEPRECATED** `utp_enabled`. Use `preferred_transports` instead.
|
||||
|
||||
@@ -69,13 +69,13 @@ void toggle_pref_cb(Gio::SimpleAction& action, gpointer /*user_data*/)
|
||||
myCore->set_pref(tr_quark_new({ key.c_str(), key.size() }), !val);
|
||||
}
|
||||
|
||||
std::array<std::string_view, 6> const pref_toggle_entries = {
|
||||
"alt-speed-enabled"sv, //
|
||||
"compact-view"sv, //
|
||||
"sort-reversed"sv, //
|
||||
"show-filterbar"sv, //
|
||||
"show-statusbar"sv, //
|
||||
"show-toolbar"sv, //
|
||||
std::array<tr_quark, 6> const pref_toggle_entries = {
|
||||
TR_KEY_alt_speed_enabled, //
|
||||
TR_KEY_compact_view, //
|
||||
TR_KEY_sort_reversed, //
|
||||
TR_KEY_show_filterbar, //
|
||||
TR_KEY_show_statusbar, //
|
||||
TR_KEY_show_toolbar, //
|
||||
};
|
||||
|
||||
std::array<std::string_view, 29> const entries = {
|
||||
@@ -148,10 +148,11 @@ Glib::RefPtr<Gio::SimpleActionGroup> gtr_actions_init(Glib::RefPtr<Gtk::Builder>
|
||||
key_to_action.try_emplace(action_name, action);
|
||||
}
|
||||
|
||||
for (auto const& action_name_view : pref_toggle_entries)
|
||||
for (auto const action_name_quark : pref_toggle_entries)
|
||||
{
|
||||
auto const action_name = Glib::ustring(std::string(action_name_view));
|
||||
auto const action = Gio::SimpleAction::create_bool(action_name, gtr_pref_flag_get(tr_quark_new(action_name_view)));
|
||||
auto const action_name_sv = tr_quark_get_string_view(action_name_quark);
|
||||
auto const action_name = Glib::ustring{ std::data(action_name_sv), std::size(action_name_sv) };
|
||||
auto const action = Gio::SimpleAction::create_bool(action_name, gtr_pref_flag_get(action_name_quark));
|
||||
action->signal_activate().connect([a = action.get(), callback_user_data](auto const& /*value*/)
|
||||
{ toggle_pref_cb(*a, callback_user_data); });
|
||||
action_group->add_action(action);
|
||||
|
||||
@@ -441,7 +441,7 @@ void DetailsDialog::Impl::torrent_set_bool(tr_quark key, bool value)
|
||||
tr_variant top;
|
||||
|
||||
tr_variantInitDict(&top, 2);
|
||||
tr_variantDictAddStrView(&top, TR_KEY_method, "torrent-set"sv);
|
||||
tr_variantDictAddStrView(&top, TR_KEY_method, tr_quark_get_string_view(TR_KEY_torrent_set_kebab));
|
||||
tr_variant* const args = tr_variantDictAddDict(&top, TR_KEY_arguments, 2);
|
||||
tr_variantDictAddBool(args, key, value);
|
||||
tr_variant* const ids = tr_variantDictAddList(args, TR_KEY_ids, ids_.size());
|
||||
@@ -459,7 +459,7 @@ void DetailsDialog::Impl::torrent_set_int(tr_quark key, int value)
|
||||
tr_variant top;
|
||||
|
||||
tr_variantInitDict(&top, 2);
|
||||
tr_variantDictAddStrView(&top, TR_KEY_method, "torrent-set"sv);
|
||||
tr_variantDictAddStrView(&top, TR_KEY_method, tr_quark_get_string_view(TR_KEY_torrent_set_kebab));
|
||||
tr_variant* const args = tr_variantDictAddDict(&top, TR_KEY_arguments, 2);
|
||||
tr_variantDictAddInt(args, key, value);
|
||||
tr_variant* const ids = tr_variantDictAddList(args, TR_KEY_ids, ids_.size());
|
||||
@@ -477,7 +477,7 @@ void DetailsDialog::Impl::torrent_set_real(tr_quark key, double value)
|
||||
tr_variant top;
|
||||
|
||||
tr_variantInitDict(&top, 2);
|
||||
tr_variantDictAddStrView(&top, TR_KEY_method, "torrent-set"sv);
|
||||
tr_variantDictAddStrView(&top, TR_KEY_method, tr_quark_get_string_view(TR_KEY_torrent_set_kebab));
|
||||
tr_variant* const args = tr_variantDictAddDict(&top, TR_KEY_arguments, 2);
|
||||
tr_variantDictAddReal(args, key, value);
|
||||
tr_variant* const ids = tr_variantDictAddList(args, TR_KEY_ids, ids_.size());
|
||||
@@ -495,29 +495,29 @@ void DetailsDialog::Impl::options_page_init(Glib::RefPtr<Gtk::Builder> const& /*
|
||||
auto const speed_units_kbyps_str = Speed::units().display_name(Speed::Units::KByps);
|
||||
|
||||
honor_limits_check_tag_ = honor_limits_check_->signal_toggled().connect(
|
||||
[this]() { torrent_set_bool(TR_KEY_honorsSessionLimits, honor_limits_check_->get_active()); });
|
||||
[this]() { torrent_set_bool(TR_KEY_honors_session_limits_camel, honor_limits_check_->get_active()); });
|
||||
|
||||
down_limited_check_->set_label(
|
||||
fmt::format(fmt::runtime(down_limited_check_->get_label().raw()), fmt::arg("speed_units", speed_units_kbyps_str)));
|
||||
down_limited_check_tag_ = down_limited_check_->signal_toggled().connect(
|
||||
[this]() { torrent_set_bool(TR_KEY_downloadLimited, down_limited_check_->get_active()); });
|
||||
[this]() { torrent_set_bool(TR_KEY_download_limited_camel, down_limited_check_->get_active()); });
|
||||
|
||||
down_limit_spin_->set_adjustment(Gtk::Adjustment::create(0, 0, std::numeric_limits<int>::max(), 5));
|
||||
down_limit_spin_tag_ = down_limit_spin_->signal_value_changed().connect(
|
||||
[this]() { torrent_set_int(TR_KEY_downloadLimit, down_limit_spin_->get_value_as_int()); });
|
||||
[this]() { torrent_set_int(TR_KEY_download_limit_camel, down_limit_spin_->get_value_as_int()); });
|
||||
|
||||
up_limited_check_->set_label(
|
||||
fmt::format(fmt::runtime(up_limited_check_->get_label().raw()), fmt::arg("speed_units", speed_units_kbyps_str)));
|
||||
up_limited_check_tag_ = up_limited_check_->signal_toggled().connect(
|
||||
[this]() { torrent_set_bool(TR_KEY_uploadLimited, up_limited_check_->get_active()); });
|
||||
[this]() { torrent_set_bool(TR_KEY_upload_limited_camel, up_limited_check_->get_active()); });
|
||||
|
||||
up_limit_sping_->set_adjustment(Gtk::Adjustment::create(0, 0, std::numeric_limits<int>::max(), 5));
|
||||
up_limit_spin_tag_ = up_limit_sping_->signal_value_changed().connect(
|
||||
[this]() { torrent_set_int(TR_KEY_uploadLimit, up_limit_sping_->get_value_as_int()); });
|
||||
[this]() { torrent_set_int(TR_KEY_upload_limit_camel, up_limit_sping_->get_value_as_int()); });
|
||||
|
||||
gtr_priority_combo_init(*bandwidth_combo_);
|
||||
bandwidth_combo_tag_ = bandwidth_combo_->signal_changed().connect(
|
||||
[this]() { torrent_set_int(TR_KEY_bandwidthPriority, gtr_combo_box_get_active_enum(*bandwidth_combo_)); });
|
||||
[this]() { torrent_set_int(TR_KEY_bandwidth_priority_camel, gtr_combo_box_get_active_enum(*bandwidth_combo_)); });
|
||||
|
||||
gtr_combo_box_set_enum(
|
||||
*ratio_combo_,
|
||||
@@ -529,13 +529,13 @@ void DetailsDialog::Impl::options_page_init(Glib::RefPtr<Gtk::Builder> const& /*
|
||||
ratio_combo_tag_ = ratio_combo_->signal_changed().connect(
|
||||
[this]()
|
||||
{
|
||||
torrent_set_int(TR_KEY_seedRatioMode, gtr_combo_box_get_active_enum(*ratio_combo_));
|
||||
torrent_set_int(TR_KEY_seed_ratio_mode_camel, gtr_combo_box_get_active_enum(*ratio_combo_));
|
||||
refresh();
|
||||
});
|
||||
ratio_spin_->set_adjustment(Gtk::Adjustment::create(0, 0, 1000, .05));
|
||||
ratio_spin_->set_width_chars(7);
|
||||
ratio_spin_tag_ = ratio_spin_->signal_value_changed().connect(
|
||||
[this]() { torrent_set_real(TR_KEY_seedRatioLimit, ratio_spin_->get_value()); });
|
||||
[this]() { torrent_set_real(TR_KEY_seed_ratio_limit_camel, ratio_spin_->get_value()); });
|
||||
|
||||
gtr_combo_box_set_enum(
|
||||
*idle_combo_,
|
||||
@@ -547,16 +547,16 @@ void DetailsDialog::Impl::options_page_init(Glib::RefPtr<Gtk::Builder> const& /*
|
||||
idle_combo_tag_ = idle_combo_->signal_changed().connect(
|
||||
[this]()
|
||||
{
|
||||
torrent_set_int(TR_KEY_seedIdleMode, gtr_combo_box_get_active_enum(*idle_combo_));
|
||||
torrent_set_int(TR_KEY_seed_idle_mode_camel, gtr_combo_box_get_active_enum(*idle_combo_));
|
||||
refresh();
|
||||
});
|
||||
idle_spin_->set_adjustment(Gtk::Adjustment::create(1, 1, 40320, 5));
|
||||
idle_spin_tag_ = idle_spin_->signal_value_changed().connect(
|
||||
[this]() { torrent_set_int(TR_KEY_seedIdleLimit, idle_spin_->get_value_as_int()); });
|
||||
[this]() { torrent_set_int(TR_KEY_seed_idle_limit_camel, idle_spin_->get_value_as_int()); });
|
||||
|
||||
max_peers_spin_->set_adjustment(Gtk::Adjustment::create(1, 1, 3000, 5));
|
||||
max_peers_spin_tag_ = max_peers_spin_->signal_value_changed().connect(
|
||||
[this]() { torrent_set_int(TR_KEY_peer_limit, max_peers_spin_->get_value_as_int()); });
|
||||
[this]() { torrent_set_int(TR_KEY_peer_limit_kebab, max_peers_spin_->get_value_as_int()); });
|
||||
}
|
||||
|
||||
/****
|
||||
@@ -2390,10 +2390,10 @@ void AddTrackerDialog::on_response(int response)
|
||||
tr_variant top;
|
||||
|
||||
tr_variantInitDict(&top, 2);
|
||||
tr_variantDictAddStrView(&top, TR_KEY_method, "torrent-set"sv);
|
||||
tr_variantDictAddStrView(&top, TR_KEY_method, tr_quark_get_string_view(TR_KEY_torrent_set_kebab));
|
||||
auto* const args = tr_variantDictAddDict(&top, TR_KEY_arguments, 2);
|
||||
tr_variantDictAddInt(args, TR_KEY_id, torrent_id_);
|
||||
auto* const trackers = tr_variantDictAddList(args, TR_KEY_trackerAdd, 1);
|
||||
auto* const trackers = tr_variantDictAddList(args, TR_KEY_tracker_add_camel, 1);
|
||||
tr_variantListAddStr(trackers, url.raw());
|
||||
|
||||
core_->exec(top);
|
||||
@@ -2437,10 +2437,10 @@ void DetailsDialog::Impl::on_tracker_list_remove_button_clicked()
|
||||
tr_variant top;
|
||||
|
||||
tr_variantInitDict(&top, 2);
|
||||
tr_variantDictAddStrView(&top, TR_KEY_method, "torrent-set"sv);
|
||||
tr_variantDictAddStrView(&top, TR_KEY_method, tr_quark_get_string_view(TR_KEY_torrent_set_kebab));
|
||||
auto* const args = tr_variantDictAddDict(&top, TR_KEY_arguments, 2);
|
||||
tr_variantDictAddInt(args, TR_KEY_id, torrent_id);
|
||||
auto* const trackers = tr_variantDictAddList(args, TR_KEY_trackerRemove, 1);
|
||||
auto* const trackers = tr_variantDictAddList(args, TR_KEY_tracker_remove_camel, 1);
|
||||
tr_variantListAddInt(trackers, tracker_id);
|
||||
|
||||
core_->exec(top);
|
||||
|
||||
@@ -982,7 +982,7 @@ void NetworkPage::updatePortStatusText()
|
||||
void NetworkPage::portTestSetSensitive()
|
||||
{
|
||||
// Depend on the RPC call status instead of the UI status, so that the widgets
|
||||
// won't be enabled even if the port peer port changed while we have port-test
|
||||
// won't be enabled even if the port peer port changed while we have port_test
|
||||
// RPC call(s) in-flight.
|
||||
auto const sensitive = !core_->port_test_pending(Session::PORT_TEST_IPV4) &&
|
||||
!core_->port_test_pending(Session::PORT_TEST_IPV6);
|
||||
@@ -1007,7 +1007,7 @@ void NetworkPage::onPortTested(std::optional<bool> const result, Session::PortTe
|
||||
|
||||
// Only update the UI if the current status is "checking", so that
|
||||
// we won't show the port test results for the old peer port if it
|
||||
// changed while we have port-test RPC call(s) in-flight.
|
||||
// changed while we have port_test RPC call(s) in-flight.
|
||||
if (auto& status = portTestStatus_[ip_protocol]; status == PORT_TEST_CHECKING)
|
||||
{
|
||||
status = ResultToStatus(result);
|
||||
|
||||
@@ -1301,7 +1301,7 @@ void Session::port_test(PortTestIpProtocol const ip_protocol)
|
||||
auto status = std::optional<bool>{};
|
||||
if (tr_variant* args = nullptr; tr_variantDictFindDict(&response, TR_KEY_arguments, &args))
|
||||
{
|
||||
if (auto result = bool{}; tr_variantDictFindBool(args, TR_KEY_port_is_open, &result))
|
||||
if (auto result = bool{}; tr_variantDictFindBool(args, TR_KEY_port_is_open_kebab, &result))
|
||||
{
|
||||
status = result;
|
||||
}
|
||||
@@ -1354,7 +1354,7 @@ void Session::blocklist_update()
|
||||
int64_t ruleCount = 0;
|
||||
|
||||
if (!tr_variantDictFindDict(&response, TR_KEY_arguments, &args) ||
|
||||
!tr_variantDictFindInt(args, TR_KEY_blocklist_size, &ruleCount))
|
||||
!tr_variantDictFindInt(args, TR_KEY_blocklist_size_kebab, &ruleCount))
|
||||
{
|
||||
ruleCount = -1;
|
||||
}
|
||||
|
||||
@@ -178,22 +178,22 @@
|
||||
<attribute name="label" translatable="true">_View</attribute>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="action">win.compact-view</attribute>
|
||||
<attribute name="action">win.compact_view</attribute>
|
||||
<attribute name="label" translatable="yes">_Compact View</attribute>
|
||||
<attribute name="accel"><alt>C</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="action">win.show-toolbar</attribute>
|
||||
<attribute name="action">win.show_toolbar</attribute>
|
||||
<attribute name="label" translatable="yes">_Toolbar</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="action">win.show-filterbar</attribute>
|
||||
<attribute name="action">win.show_filterbar</attribute>
|
||||
<attribute name="label" translatable="yes">_Filterbar</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="action">win.show-statusbar</attribute>
|
||||
<attribute name="action">win.show_statusbar</attribute>
|
||||
<attribute name="label" translatable="yes">_Statusbar</attribute>
|
||||
</item>
|
||||
</section>
|
||||
@@ -246,7 +246,7 @@
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="action">win.sort-reversed</attribute>
|
||||
<attribute name="action">win.sort_reversed</attribute>
|
||||
<attribute name="label" translatable="yes">Re_verse Sort Order</attribute>
|
||||
</item>
|
||||
</section>
|
||||
@@ -353,7 +353,7 @@
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="action">win.sort-reversed</attribute>
|
||||
<attribute name="action">win.sort_reversed</attribute>
|
||||
<attribute name="label" translatable="yes">Re_verse Sort Order</attribute>
|
||||
</item>
|
||||
</section>
|
||||
@@ -482,7 +482,7 @@
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="action">win.alt-speed-enabled</attribute>
|
||||
<attribute name="action">win.alt_speed_enabled</attribute>
|
||||
<attribute name="label" translatable="yes">Enable Alternative Speed _Limits</attribute>
|
||||
</item>
|
||||
</section>
|
||||
|
||||
@@ -21,14 +21,17 @@ namespace
|
||||
auto constexpr MyStatic = std::array<std::string_view, TR_N_KEYS>{
|
||||
""sv,
|
||||
"activeTorrentCount"sv,
|
||||
"active_torrent_count"sv,
|
||||
"activity-date"sv,
|
||||
"activityDate"sv,
|
||||
"activity_date"sv,
|
||||
"added"sv,
|
||||
"added-date"sv,
|
||||
"added.f"sv,
|
||||
"added6"sv,
|
||||
"added6.f"sv,
|
||||
"addedDate"sv,
|
||||
"added_date"sv,
|
||||
"address"sv,
|
||||
"alt-speed-down"sv,
|
||||
"alt-speed-enabled"sv,
|
||||
@@ -37,60 +40,98 @@ auto constexpr MyStatic = std::array<std::string_view, TR_N_KEYS>{
|
||||
"alt-speed-time-enabled"sv,
|
||||
"alt-speed-time-end"sv,
|
||||
"alt-speed-up"sv,
|
||||
"alt_speed_down"sv,
|
||||
"alt_speed_enabled"sv,
|
||||
"alt_speed_time_begin"sv,
|
||||
"alt_speed_time_day"sv,
|
||||
"alt_speed_time_enabled"sv,
|
||||
"alt_speed_time_end"sv,
|
||||
"alt_speed_up"sv,
|
||||
"announce"sv,
|
||||
"announce-ip"sv,
|
||||
"announce-ip-enabled"sv,
|
||||
"announce-list"sv,
|
||||
"announceState"sv,
|
||||
"announce_ip"sv,
|
||||
"announce_ip_enabled"sv,
|
||||
"announce_state"sv,
|
||||
"anti-brute-force-enabled"sv,
|
||||
"anti-brute-force-threshold"sv,
|
||||
"anti_brute_force_enabled"sv,
|
||||
"anti_brute_force_threshold"sv,
|
||||
"arguments"sv,
|
||||
"availability"sv,
|
||||
"bandwidth-priority"sv,
|
||||
"bandwidthPriority"sv,
|
||||
"bandwidth_priority"sv,
|
||||
"begin_piece"sv,
|
||||
"bind-address-ipv4"sv,
|
||||
"bind-address-ipv6"sv,
|
||||
"bind_address_ipv4"sv,
|
||||
"bind_address_ipv6"sv,
|
||||
"bitfield"sv,
|
||||
"blocklist-date"sv,
|
||||
"blocklist-enabled"sv,
|
||||
"blocklist-size"sv,
|
||||
"blocklist-updates-enabled"sv,
|
||||
"blocklist-url"sv,
|
||||
"blocklist_date"sv,
|
||||
"blocklist_enabled"sv,
|
||||
"blocklist_size"sv,
|
||||
"blocklist_updates_enabled"sv,
|
||||
"blocklist_url"sv,
|
||||
"blocks"sv,
|
||||
"bytesCompleted"sv,
|
||||
"bytes_completed"sv,
|
||||
"bytes_to_client"sv,
|
||||
"bytes_to_peer"sv,
|
||||
"cache-size-mb"sv,
|
||||
"cache_size_mb"sv,
|
||||
"clientIsChoked"sv,
|
||||
"clientIsInterested"sv,
|
||||
"clientName"sv,
|
||||
"client_is_choked"sv,
|
||||
"client_is_interested"sv,
|
||||
"client_name"sv,
|
||||
"code"sv,
|
||||
"comment"sv,
|
||||
"compact-view"sv,
|
||||
"compact_view"sv,
|
||||
"complete"sv,
|
||||
"config-dir"sv,
|
||||
"config_dir"sv,
|
||||
"cookies"sv,
|
||||
"corrupt"sv,
|
||||
"corruptEver"sv,
|
||||
"corrupt_ever"sv,
|
||||
"created by"sv,
|
||||
"creation date"sv,
|
||||
"creator"sv,
|
||||
"cumulative-stats"sv,
|
||||
"cumulative_stats"sv,
|
||||
"current-stats"sv,
|
||||
"current_stats"sv,
|
||||
"data"sv,
|
||||
"date"sv,
|
||||
"dateCreated"sv,
|
||||
"date_created"sv,
|
||||
"default-trackers"sv,
|
||||
"default_trackers"sv,
|
||||
"delete-local-data"sv,
|
||||
"delete_local_data"sv,
|
||||
"desiredAvailable"sv,
|
||||
"desired_available"sv,
|
||||
"destination"sv,
|
||||
"details-window-height"sv,
|
||||
"details-window-width"sv,
|
||||
"details_window_height"sv,
|
||||
"details_window_width"sv,
|
||||
"dht-enabled"sv,
|
||||
"dht_enabled"sv,
|
||||
"dnd"sv,
|
||||
"done-date"sv,
|
||||
"doneDate"sv,
|
||||
"done_date"sv,
|
||||
"download-dir"sv,
|
||||
"download-dir-free-space"sv,
|
||||
"download-queue-enabled"sv,
|
||||
@@ -100,36 +141,59 @@ auto constexpr MyStatic = std::array<std::string_view, TR_N_KEYS>{
|
||||
"downloadLimit"sv,
|
||||
"downloadLimited"sv,
|
||||
"downloadSpeed"sv,
|
||||
"download_count"sv,
|
||||
"download_dir"sv,
|
||||
"download_dir_free_space"sv,
|
||||
"download_limit"sv,
|
||||
"download_limited"sv,
|
||||
"download_queue_enabled"sv,
|
||||
"download_queue_size"sv,
|
||||
"download_speed"sv,
|
||||
"downloaded"sv,
|
||||
"downloaded-bytes"sv,
|
||||
"downloadedBytes"sv,
|
||||
"downloadedEver"sv,
|
||||
"downloaded_bytes"sv,
|
||||
"downloaded_ever"sv,
|
||||
"downloader_count"sv,
|
||||
"downloading-time-seconds"sv,
|
||||
"downloading_time_seconds"sv,
|
||||
"dropped"sv,
|
||||
"dropped6"sv,
|
||||
"e"sv,
|
||||
"editDate"sv,
|
||||
"edit_date"sv,
|
||||
"encoding"sv,
|
||||
"encryption"sv,
|
||||
"end_piece"sv,
|
||||
"error"sv,
|
||||
"errorString"sv,
|
||||
"error_string"sv,
|
||||
"eta"sv,
|
||||
"etaIdle"sv,
|
||||
"eta_idle"sv,
|
||||
"fields"sv,
|
||||
"file-count"sv,
|
||||
"fileStats"sv,
|
||||
"file_count"sv,
|
||||
"file_stats"sv,
|
||||
"filename"sv,
|
||||
"files"sv,
|
||||
"files-added"sv,
|
||||
"files-unwanted"sv,
|
||||
"files-wanted"sv,
|
||||
"filesAdded"sv,
|
||||
"files_added"sv,
|
||||
"files_unwanted"sv,
|
||||
"files_wanted"sv,
|
||||
"filter-mode"sv,
|
||||
"filter-text"sv,
|
||||
"filter-trackers"sv,
|
||||
"filter_mode"sv,
|
||||
"filter_text"sv,
|
||||
"filter_trackers"sv,
|
||||
"flagStr"sv,
|
||||
"flag_str"sv,
|
||||
"flags"sv,
|
||||
"format"sv,
|
||||
"fromCache"sv,
|
||||
@@ -139,14 +203,27 @@ auto constexpr MyStatic = std::array<std::string_view, TR_N_KEYS>{
|
||||
"fromLtep"sv,
|
||||
"fromPex"sv,
|
||||
"fromTracker"sv,
|
||||
"from_cache"sv,
|
||||
"from_dht"sv,
|
||||
"from_incoming"sv,
|
||||
"from_lpd"sv,
|
||||
"from_ltep"sv,
|
||||
"from_pex"sv,
|
||||
"from_tracker"sv,
|
||||
"group"sv,
|
||||
"hasAnnounced"sv,
|
||||
"hasScraped"sv,
|
||||
"has_announced"sv,
|
||||
"has_scraped"sv,
|
||||
"hashString"sv,
|
||||
"hash_string"sv,
|
||||
"have"sv,
|
||||
"haveUnchecked"sv,
|
||||
"haveValid"sv,
|
||||
"have_unchecked"sv,
|
||||
"have_valid"sv,
|
||||
"honorsSessionLimits"sv,
|
||||
"honors_session_limits"sv,
|
||||
"host"sv,
|
||||
"id"sv,
|
||||
"id_timestamp"sv,
|
||||
@@ -154,12 +231,19 @@ auto constexpr MyStatic = std::array<std::string_view, TR_N_KEYS>{
|
||||
"idle-mode"sv,
|
||||
"idle-seeding-limit"sv,
|
||||
"idle-seeding-limit-enabled"sv,
|
||||
"idle_limit"sv,
|
||||
"idle_mode"sv,
|
||||
"idle_seeding_limit"sv,
|
||||
"idle_seeding_limit_enabled"sv,
|
||||
"ids"sv,
|
||||
"incomplete"sv,
|
||||
"incomplete-dir"sv,
|
||||
"incomplete-dir-enabled"sv,
|
||||
"incomplete_dir"sv,
|
||||
"incomplete_dir_enabled"sv,
|
||||
"info"sv,
|
||||
"inhibit-desktop-hibernation"sv,
|
||||
"inhibit_desktop_hibernation"sv,
|
||||
"ip_protocol"sv,
|
||||
"ipv4"sv,
|
||||
"ipv6"sv,
|
||||
@@ -172,6 +256,15 @@ auto constexpr MyStatic = std::array<std::string_view, TR_N_KEYS>{
|
||||
"isStalled"sv,
|
||||
"isUTP"sv,
|
||||
"isUploadingTo"sv,
|
||||
"is_backup"sv,
|
||||
"is_downloading_from"sv,
|
||||
"is_encrypted"sv,
|
||||
"is_finished"sv,
|
||||
"is_incoming"sv,
|
||||
"is_private"sv,
|
||||
"is_stalled"sv,
|
||||
"is_uploading_to"sv,
|
||||
"is_utp"sv,
|
||||
"jsonrpc"sv,
|
||||
"labels"sv,
|
||||
"lastAnnouncePeerCount"sv,
|
||||
@@ -185,27 +278,55 @@ auto constexpr MyStatic = std::array<std::string_view, TR_N_KEYS>{
|
||||
"lastScrapeSucceeded"sv,
|
||||
"lastScrapeTime"sv,
|
||||
"lastScrapeTimedOut"sv,
|
||||
"last_announce_peer_count"sv,
|
||||
"last_announce_result"sv,
|
||||
"last_announce_start_time"sv,
|
||||
"last_announce_succeeded"sv,
|
||||
"last_announce_time"sv,
|
||||
"last_announce_timed_out"sv,
|
||||
"last_scrape_result"sv,
|
||||
"last_scrape_start_time"sv,
|
||||
"last_scrape_succeeded"sv,
|
||||
"last_scrape_time"sv,
|
||||
"last_scrape_timed_out"sv,
|
||||
"leecherCount"sv,
|
||||
"leecher_count"sv,
|
||||
"leftUntilDone"sv,
|
||||
"left_until_done"sv,
|
||||
"length"sv,
|
||||
"location"sv,
|
||||
"lpd-enabled"sv,
|
||||
"lpd_enabled"sv,
|
||||
"m"sv,
|
||||
"magnetLink"sv,
|
||||
"magnet_link"sv,
|
||||
"main-window-height"sv,
|
||||
"main-window-is-maximized"sv,
|
||||
"main-window-layout-order"sv,
|
||||
"main-window-width"sv,
|
||||
"main-window-x"sv,
|
||||
"main-window-y"sv,
|
||||
"main_window_height"sv,
|
||||
"main_window_is_maximized"sv,
|
||||
"main_window_layout_order"sv,
|
||||
"main_window_width"sv,
|
||||
"main_window_x"sv,
|
||||
"main_window_y"sv,
|
||||
"manualAnnounceTime"sv,
|
||||
"manual_announce_time"sv,
|
||||
"max-peers"sv,
|
||||
"maxConnectedPeers"sv,
|
||||
"max_connected_peers"sv,
|
||||
"max_peers"sv,
|
||||
"memory-bytes"sv,
|
||||
"memory-units"sv,
|
||||
"memory_bytes"sv,
|
||||
"memory_units"sv,
|
||||
"message"sv,
|
||||
"message-level"sv,
|
||||
"message_level"sv,
|
||||
"metadataPercentComplete"sv,
|
||||
"metadata_percent_complete"sv,
|
||||
"metadata_size"sv,
|
||||
"metainfo"sv,
|
||||
"method"sv,
|
||||
@@ -215,14 +336,18 @@ auto constexpr MyStatic = std::array<std::string_view, TR_N_KEYS>{
|
||||
"name"sv,
|
||||
"nextAnnounceTime"sv,
|
||||
"nextScrapeTime"sv,
|
||||
"next_announce_time"sv,
|
||||
"next_scrape_time"sv,
|
||||
"nodes"sv,
|
||||
"nodes6"sv,
|
||||
"open-dialog-dir"sv,
|
||||
"open_dialog_dir"sv,
|
||||
"p"sv,
|
||||
"params"sv,
|
||||
"path"sv,
|
||||
"paused"sv,
|
||||
"pausedTorrentCount"sv,
|
||||
"paused_torrent_count"sv,
|
||||
"peer-congestion-algorithm"sv,
|
||||
"peer-limit"sv,
|
||||
"peer-limit-global"sv,
|
||||
@@ -234,50 +359,90 @@ auto constexpr MyStatic = std::array<std::string_view, TR_N_KEYS>{
|
||||
"peer-socket-tos"sv,
|
||||
"peerIsChoked"sv,
|
||||
"peerIsInterested"sv,
|
||||
"peer_congestion_algorithm"sv,
|
||||
"peer_id"sv,
|
||||
"peer_is_choked"sv,
|
||||
"peer_is_interested"sv,
|
||||
"peer_limit"sv,
|
||||
"peer_limit_global"sv,
|
||||
"peer_limit_per_torrent"sv,
|
||||
"peer_port"sv,
|
||||
"peer_port_random_high"sv,
|
||||
"peer_port_random_low"sv,
|
||||
"peer_port_random_on_start"sv,
|
||||
"peer_socket_tos"sv,
|
||||
"peers"sv,
|
||||
"peers2"sv,
|
||||
"peers2-6"sv,
|
||||
"peers2_6"sv,
|
||||
"peersConnected"sv,
|
||||
"peersFrom"sv,
|
||||
"peersGettingFromUs"sv,
|
||||
"peersSendingToUs"sv,
|
||||
"peers_connected"sv,
|
||||
"peers_from"sv,
|
||||
"peers_getting_from_us"sv,
|
||||
"peers_sending_to_us"sv,
|
||||
"percentComplete"sv,
|
||||
"percentDone"sv,
|
||||
"percent_complete"sv,
|
||||
"percent_done"sv,
|
||||
"pex-enabled"sv,
|
||||
"pex_enabled"sv,
|
||||
"pidfile"sv,
|
||||
"piece"sv,
|
||||
"piece length"sv,
|
||||
"pieceCount"sv,
|
||||
"pieceSize"sv,
|
||||
"piece_count"sv,
|
||||
"piece_size"sv,
|
||||
"pieces"sv,
|
||||
"port"sv,
|
||||
"port-forwarding-enabled"sv,
|
||||
"port-is-open"sv,
|
||||
"port_forwarding_enabled"sv,
|
||||
"port_is_open"sv,
|
||||
"preallocation"sv,
|
||||
"preferred_transports"sv,
|
||||
"primary-mime-type"sv,
|
||||
"primary_mime_type"sv,
|
||||
"priorities"sv,
|
||||
"priority"sv,
|
||||
"priority-high"sv,
|
||||
"priority-low"sv,
|
||||
"priority-normal"sv,
|
||||
"priority_high"sv,
|
||||
"priority_low"sv,
|
||||
"priority_normal"sv,
|
||||
"private"sv,
|
||||
"progress"sv,
|
||||
"prompt-before-exit"sv,
|
||||
"prompt_before_exit"sv,
|
||||
"proxy_url"sv,
|
||||
"queue-stalled-enabled"sv,
|
||||
"queue-stalled-minutes"sv,
|
||||
"queuePosition"sv,
|
||||
"queue_position"sv,
|
||||
"queue_stalled_enabled"sv,
|
||||
"queue_stalled_minutes"sv,
|
||||
"rateDownload"sv,
|
||||
"rateToClient"sv,
|
||||
"rateToPeer"sv,
|
||||
"rateUpload"sv,
|
||||
"rate_download"sv,
|
||||
"rate_to_client"sv,
|
||||
"rate_to_peer"sv,
|
||||
"rate_upload"sv,
|
||||
"ratio-limit"sv,
|
||||
"ratio-limit-enabled"sv,
|
||||
"ratio-mode"sv,
|
||||
"ratio_limit"sv,
|
||||
"ratio_limit_enabled"sv,
|
||||
"ratio_mode"sv,
|
||||
"read-clipboard"sv,
|
||||
"read_clipboard"sv,
|
||||
"recheckProgress"sv,
|
||||
"recheck_progress"sv,
|
||||
"remote-session-enabled"sv,
|
||||
"remote-session-host"sv,
|
||||
"remote-session-https"sv,
|
||||
@@ -285,9 +450,17 @@ auto constexpr MyStatic = std::array<std::string_view, TR_N_KEYS>{
|
||||
"remote-session-port"sv,
|
||||
"remote-session-requres-authentication"sv,
|
||||
"remote-session-username"sv,
|
||||
"remote_session_enabled"sv,
|
||||
"remote_session_host"sv,
|
||||
"remote_session_https"sv,
|
||||
"remote_session_password"sv,
|
||||
"remote_session_port"sv,
|
||||
"remote_session_requires_authentication"sv,
|
||||
"remote_session_rpc_url_path"sv,
|
||||
"remote_session_username"sv,
|
||||
"removed"sv,
|
||||
"rename-partial-files"sv,
|
||||
"rename_partial_files"sv,
|
||||
"reqq"sv,
|
||||
"result"sv,
|
||||
"rpc-authentication-required"sv,
|
||||
@@ -305,19 +478,45 @@ auto constexpr MyStatic = std::array<std::string_view, TR_N_KEYS>{
|
||||
"rpc-version-semver"sv,
|
||||
"rpc-whitelist"sv,
|
||||
"rpc-whitelist-enabled"sv,
|
||||
"rpc_authentication_required"sv,
|
||||
"rpc_bind_address"sv,
|
||||
"rpc_enabled"sv,
|
||||
"rpc_host_whitelist"sv,
|
||||
"rpc_host_whitelist_enabled"sv,
|
||||
"rpc_password"sv,
|
||||
"rpc_port"sv,
|
||||
"rpc_socket_mode"sv,
|
||||
"rpc_url"sv,
|
||||
"rpc_username"sv,
|
||||
"rpc_version"sv,
|
||||
"rpc_version_minimum"sv,
|
||||
"rpc_version_semver"sv,
|
||||
"rpc_whitelist"sv,
|
||||
"rpc_whitelist_enabled"sv,
|
||||
"scrape"sv,
|
||||
"scrape-paused-torrents-enabled"sv,
|
||||
"scrapeState"sv,
|
||||
"scrape_paused_torrents_enabled"sv,
|
||||
"scrape_state"sv,
|
||||
"script-torrent-added-enabled"sv,
|
||||
"script-torrent-added-filename"sv,
|
||||
"script-torrent-done-enabled"sv,
|
||||
"script-torrent-done-filename"sv,
|
||||
"script-torrent-done-seeding-enabled"sv,
|
||||
"script-torrent-done-seeding-filename"sv,
|
||||
"script_torrent_added_enabled"sv,
|
||||
"script_torrent_added_filename"sv,
|
||||
"script_torrent_done_enabled"sv,
|
||||
"script_torrent_done_filename"sv,
|
||||
"script_torrent_done_seeding_enabled"sv,
|
||||
"script_torrent_done_seeding_filename"sv,
|
||||
"seconds-active"sv,
|
||||
"secondsActive"sv,
|
||||
"secondsDownloading"sv,
|
||||
"secondsSeeding"sv,
|
||||
"seconds_active"sv,
|
||||
"seconds_downloading"sv,
|
||||
"seconds_seeding"sv,
|
||||
"seed-queue-enabled"sv,
|
||||
"seed-queue-size"sv,
|
||||
"seedIdleLimit"sv,
|
||||
@@ -325,13 +524,24 @@ auto constexpr MyStatic = std::array<std::string_view, TR_N_KEYS>{
|
||||
"seedRatioLimit"sv,
|
||||
"seedRatioLimited"sv,
|
||||
"seedRatioMode"sv,
|
||||
"seed_idle_limit"sv,
|
||||
"seed_idle_mode"sv,
|
||||
"seed_queue_enabled"sv,
|
||||
"seed_queue_size"sv,
|
||||
"seed_ratio_limit"sv,
|
||||
"seed_ratio_limited"sv,
|
||||
"seed_ratio_mode"sv,
|
||||
"seederCount"sv,
|
||||
"seeder_count"sv,
|
||||
"seeding-time-seconds"sv,
|
||||
"seeding_time_seconds"sv,
|
||||
"sequential_download"sv,
|
||||
"sequential_download_from_piece"sv,
|
||||
"session-count"sv,
|
||||
"session-id"sv,
|
||||
"sessionCount"sv,
|
||||
"session_count"sv,
|
||||
"session_id"sv,
|
||||
"show-backup-trackers"sv,
|
||||
"show-extra-peer-details"sv,
|
||||
"show-filterbar"sv,
|
||||
@@ -340,14 +550,27 @@ auto constexpr MyStatic = std::array<std::string_view, TR_N_KEYS>{
|
||||
"show-statusbar"sv,
|
||||
"show-toolbar"sv,
|
||||
"show-tracker-scrapes"sv,
|
||||
"show_backup_trackers"sv,
|
||||
"show_extra_peer_details"sv,
|
||||
"show_filterbar"sv,
|
||||
"show_notification_area_icon"sv,
|
||||
"show_options_window"sv,
|
||||
"show_statusbar"sv,
|
||||
"show_toolbar"sv,
|
||||
"show_tracker_scrapes"sv,
|
||||
"sitename"sv,
|
||||
"size-bytes"sv,
|
||||
"size-units"sv,
|
||||
"sizeWhenDone"sv,
|
||||
"sleep-per-seconds-during-verify"sv,
|
||||
"size_bytes"sv,
|
||||
"size_units"sv,
|
||||
"size_when_done"sv,
|
||||
"sleep_per_seconds_during_verify"sv,
|
||||
"socket_address"sv,
|
||||
"sort-mode"sv,
|
||||
"sort-reversed"sv,
|
||||
"sort_mode"sv,
|
||||
"sort_reversed"sv,
|
||||
"source"sv,
|
||||
"speed"sv,
|
||||
"speed-Bps"sv,
|
||||
@@ -357,14 +580,26 @@ auto constexpr MyStatic = std::array<std::string_view, TR_N_KEYS>{
|
||||
"speed-limit-up"sv,
|
||||
"speed-limit-up-enabled"sv,
|
||||
"speed-units"sv,
|
||||
"speed_Bps"sv,
|
||||
"speed_bytes"sv,
|
||||
"speed_limit_down"sv,
|
||||
"speed_limit_down_enabled"sv,
|
||||
"speed_limit_up"sv,
|
||||
"speed_limit_up_enabled"sv,
|
||||
"speed_units"sv,
|
||||
"start-added-torrents"sv,
|
||||
"start-minimized"sv,
|
||||
"startDate"sv,
|
||||
"start_added_torrents"sv,
|
||||
"start_date"sv,
|
||||
"start_minimized"sv,
|
||||
"start_paused"sv,
|
||||
"status"sv,
|
||||
"statusbar-stats"sv,
|
||||
"statusbar_stats"sv,
|
||||
"tag"sv,
|
||||
"tcp-enabled"sv,
|
||||
"tcp_enabled"sv,
|
||||
"tier"sv,
|
||||
"time-checked"sv,
|
||||
"torrent-added"sv,
|
||||
@@ -381,7 +616,19 @@ auto constexpr MyStatic = std::array<std::string_view, TR_N_KEYS>{
|
||||
"torrent-set-location"sv,
|
||||
"torrentCount"sv,
|
||||
"torrentFile"sv,
|
||||
"torrent_added"sv,
|
||||
"torrent_added_notification_enabled"sv,
|
||||
"torrent_added_verify_mode"sv,
|
||||
"torrent_complete_notification_enabled"sv,
|
||||
"torrent_complete_sound_command"sv,
|
||||
"torrent_complete_sound_enabled"sv,
|
||||
"torrent_complete_verify_enabled"sv,
|
||||
"torrent_count"sv,
|
||||
"torrent_duplicate"sv,
|
||||
"torrent_file"sv,
|
||||
"torrent_get"sv,
|
||||
"torrent_set"sv,
|
||||
"torrent_set_location"sv,
|
||||
"torrents"sv,
|
||||
"totalSize"sv,
|
||||
"total_size"sv,
|
||||
@@ -390,9 +637,16 @@ auto constexpr MyStatic = std::array<std::string_view, TR_N_KEYS>{
|
||||
"trackerRemove"sv,
|
||||
"trackerReplace"sv,
|
||||
"trackerStats"sv,
|
||||
"tracker_add"sv,
|
||||
"tracker_list"sv,
|
||||
"tracker_remove"sv,
|
||||
"tracker_replace"sv,
|
||||
"tracker_stats"sv,
|
||||
"trackers"sv,
|
||||
"trash-can-enabled"sv,
|
||||
"trash-original-torrent-files"sv,
|
||||
"trash_can_enabled"sv,
|
||||
"trash_original_torrent_files"sv,
|
||||
"umask"sv,
|
||||
"units"sv,
|
||||
"upload-slots-per-torrent"sv,
|
||||
@@ -400,27 +654,42 @@ auto constexpr MyStatic = std::array<std::string_view, TR_N_KEYS>{
|
||||
"uploadLimited"sv,
|
||||
"uploadRatio"sv,
|
||||
"uploadSpeed"sv,
|
||||
"upload_limit"sv,
|
||||
"upload_limited"sv,
|
||||
"upload_only"sv,
|
||||
"upload_ratio"sv,
|
||||
"upload_slots_per_torrent"sv,
|
||||
"upload_speed"sv,
|
||||
"uploaded"sv,
|
||||
"uploaded-bytes"sv,
|
||||
"uploadedBytes"sv,
|
||||
"uploadedEver"sv,
|
||||
"uploaded_bytes"sv,
|
||||
"uploaded_ever"sv,
|
||||
"url-list"sv,
|
||||
"use-global-speed-limit"sv,
|
||||
"use-speed-limit"sv,
|
||||
"use_global_speed_limit"sv,
|
||||
"use_speed_limit"sv,
|
||||
"user-has-given-informed-consent"sv,
|
||||
"user_has_given_informed_consent"sv,
|
||||
"ut_holepunch"sv,
|
||||
"ut_metadata"sv,
|
||||
"ut_pex"sv,
|
||||
"utp-enabled"sv,
|
||||
"utp_enabled"sv,
|
||||
"v"sv,
|
||||
"version"sv,
|
||||
"wanted"sv,
|
||||
"watch-dir"sv,
|
||||
"watch-dir-enabled"sv,
|
||||
"watch-dir-force-generic"sv,
|
||||
"watch_dir"sv,
|
||||
"watch_dir_enabled"sv,
|
||||
"watch_dir_force_generic"sv,
|
||||
"webseeds"sv,
|
||||
"webseedsSendingToUs"sv,
|
||||
"webseeds_sending_to_us"sv,
|
||||
"yourip"sv,
|
||||
};
|
||||
|
||||
@@ -486,3 +755,303 @@ std::string_view tr_quark_get_string_view(tr_quark q)
|
||||
{
|
||||
return q < TR_N_KEYS ? MyStatic[q] : my_runtime[q - TR_N_KEYS];
|
||||
}
|
||||
|
||||
tr_quark tr_quark_convert(tr_quark q)
|
||||
{
|
||||
// clang-format off
|
||||
switch (q)
|
||||
{
|
||||
case TR_KEY_active_torrent_count_camel: return TR_KEY_active_torrent_count;
|
||||
case TR_KEY_activity_date_camel:
|
||||
case TR_KEY_activity_date_kebab:
|
||||
return TR_KEY_activity_date;
|
||||
case TR_KEY_added_date_camel:
|
||||
case TR_KEY_added_date_kebab:
|
||||
return TR_KEY_added_date;
|
||||
case TR_KEY_alt_speed_down_kebab: return TR_KEY_alt_speed_down;
|
||||
case TR_KEY_alt_speed_enabled_kebab: return TR_KEY_alt_speed_enabled;
|
||||
case TR_KEY_alt_speed_time_begin_kebab: return TR_KEY_alt_speed_time_begin;
|
||||
case TR_KEY_alt_speed_time_day_kebab: return TR_KEY_alt_speed_time_day;
|
||||
case TR_KEY_alt_speed_time_enabled_kebab: return TR_KEY_alt_speed_time_enabled;
|
||||
case TR_KEY_alt_speed_time_end_kebab: return TR_KEY_alt_speed_time_end;
|
||||
case TR_KEY_alt_speed_up_kebab: return TR_KEY_alt_speed_up;
|
||||
case TR_KEY_announce_ip_kebab: return TR_KEY_announce_ip;
|
||||
case TR_KEY_announce_ip_enabled_kebab: return TR_KEY_announce_ip_enabled;
|
||||
case TR_KEY_announce_state_camel: return TR_KEY_announce_state;
|
||||
case TR_KEY_anti_brute_force_enabled_kebab: return TR_KEY_anti_brute_force_enabled;
|
||||
case TR_KEY_anti_brute_force_threshold_kebab: return TR_KEY_anti_brute_force_threshold;
|
||||
case TR_KEY_bandwidth_priority_camel:
|
||||
case TR_KEY_bandwidth_priority_kebab:
|
||||
return TR_KEY_bandwidth_priority;
|
||||
case TR_KEY_bind_address_ipv4_kebab: return TR_KEY_bind_address_ipv4;
|
||||
case TR_KEY_bind_address_ipv6_kebab: return TR_KEY_bind_address_ipv6;
|
||||
case TR_KEY_blocklist_date_kebab: return TR_KEY_blocklist_date;
|
||||
case TR_KEY_blocklist_enabled_kebab: return TR_KEY_blocklist_enabled;
|
||||
case TR_KEY_blocklist_size_kebab: return TR_KEY_blocklist_size;
|
||||
case TR_KEY_blocklist_updates_enabled_kebab: return TR_KEY_blocklist_updates_enabled;
|
||||
case TR_KEY_blocklist_url_kebab: return TR_KEY_blocklist_url;
|
||||
case TR_KEY_bytes_completed_camel: return TR_KEY_bytes_completed;
|
||||
case TR_KEY_cache_size_mb_kebab: return TR_KEY_cache_size_mb;
|
||||
case TR_KEY_client_is_choked_camel: return TR_KEY_client_is_choked;
|
||||
case TR_KEY_client_is_interested_camel: return TR_KEY_client_is_interested;
|
||||
case TR_KEY_client_name_camel: return TR_KEY_client_name;
|
||||
case TR_KEY_compact_view_kebab: return TR_KEY_compact_view;
|
||||
case TR_KEY_config_dir_kebab: return TR_KEY_config_dir;
|
||||
case TR_KEY_corrupt_ever_camel: return TR_KEY_corrupt_ever;
|
||||
case TR_KEY_cumulative_stats_kebab: return TR_KEY_cumulative_stats;
|
||||
case TR_KEY_current_stats_kebab: return TR_KEY_current_stats;
|
||||
case TR_KEY_date_created_camel: return TR_KEY_date_created;
|
||||
case TR_KEY_default_trackers_kebab: return TR_KEY_default_trackers;
|
||||
case TR_KEY_delete_local_data_kebab: return TR_KEY_delete_local_data;
|
||||
case TR_KEY_desired_available_camel: return TR_KEY_desired_available;
|
||||
case TR_KEY_details_window_height_kebab: return TR_KEY_details_window_height;
|
||||
case TR_KEY_details_window_width_kebab: return TR_KEY_details_window_width;
|
||||
case TR_KEY_dht_enabled_kebab: return TR_KEY_dht_enabled;
|
||||
case TR_KEY_done_date_camel:
|
||||
case TR_KEY_done_date_kebab:
|
||||
return TR_KEY_done_date;
|
||||
case TR_KEY_download_count_camel: return TR_KEY_download_count;
|
||||
case TR_KEY_download_dir_camel:
|
||||
case TR_KEY_download_dir_kebab:
|
||||
return TR_KEY_download_dir;
|
||||
case TR_KEY_download_dir_free_space_kebab: return TR_KEY_download_dir_free_space;
|
||||
case TR_KEY_download_limit_camel: return TR_KEY_download_limit;
|
||||
case TR_KEY_download_limited_camel: return TR_KEY_download_limited;
|
||||
case TR_KEY_download_queue_enabled_kebab: return TR_KEY_download_queue_enabled;
|
||||
case TR_KEY_download_queue_size_kebab: return TR_KEY_download_queue_size;
|
||||
case TR_KEY_download_speed_camel: return TR_KEY_download_speed;
|
||||
case TR_KEY_downloaded_bytes_camel:
|
||||
case TR_KEY_downloaded_bytes_kebab:
|
||||
return TR_KEY_downloaded_bytes;
|
||||
case TR_KEY_downloaded_ever_camel: return TR_KEY_downloaded_ever;
|
||||
case TR_KEY_downloading_time_seconds_kebab: return TR_KEY_downloading_time_seconds;
|
||||
case TR_KEY_edit_date_camel: return TR_KEY_edit_date;
|
||||
case TR_KEY_error_string_camel: return TR_KEY_error_string;
|
||||
case TR_KEY_eta_idle_camel: return TR_KEY_eta_idle;
|
||||
case TR_KEY_file_count_kebab: return TR_KEY_file_count;
|
||||
case TR_KEY_file_stats_camel: return TR_KEY_file_stats;
|
||||
case TR_KEY_files_added_camel:
|
||||
case TR_KEY_files_added_kebab:
|
||||
return TR_KEY_files_added;
|
||||
case TR_KEY_files_unwanted_kebab: return TR_KEY_files_unwanted;
|
||||
case TR_KEY_files_wanted_kebab: return TR_KEY_files_wanted;
|
||||
case TR_KEY_filter_mode_kebab: return TR_KEY_filter_mode;
|
||||
case TR_KEY_filter_text_kebab: return TR_KEY_filter_text;
|
||||
case TR_KEY_filter_trackers_kebab: return TR_KEY_filter_trackers;
|
||||
case TR_KEY_flag_str_camel: return TR_KEY_flag_str;
|
||||
case TR_KEY_from_cache_camel: return TR_KEY_from_cache;
|
||||
case TR_KEY_from_dht_camel: return TR_KEY_from_dht;
|
||||
case TR_KEY_from_incoming_camel: return TR_KEY_from_incoming;
|
||||
case TR_KEY_from_lpd_camel: return TR_KEY_from_lpd;
|
||||
case TR_KEY_from_ltep_camel: return TR_KEY_from_ltep;
|
||||
case TR_KEY_from_pex_camel: return TR_KEY_from_pex;
|
||||
case TR_KEY_from_tracker_camel: return TR_KEY_from_tracker;
|
||||
case TR_KEY_hash_string_camel: return TR_KEY_hash_string;
|
||||
case TR_KEY_has_announced_camel: return TR_KEY_has_announced;
|
||||
case TR_KEY_has_scraped_camel: return TR_KEY_has_scraped;
|
||||
case TR_KEY_have_unchecked_camel: return TR_KEY_have_unchecked;
|
||||
case TR_KEY_have_valid_camel: return TR_KEY_have_valid;
|
||||
case TR_KEY_honors_session_limits_camel: return TR_KEY_honors_session_limits;
|
||||
case TR_KEY_idle_limit_kebab: return TR_KEY_idle_limit;
|
||||
case TR_KEY_idle_mode_kebab: return TR_KEY_idle_mode;
|
||||
case TR_KEY_idle_seeding_limit_kebab: return TR_KEY_idle_seeding_limit;
|
||||
case TR_KEY_idle_seeding_limit_enabled_kebab: return TR_KEY_idle_seeding_limit_enabled;
|
||||
case TR_KEY_incomplete_dir_kebab: return TR_KEY_incomplete_dir;
|
||||
case TR_KEY_incomplete_dir_enabled_kebab: return TR_KEY_incomplete_dir_enabled;
|
||||
case TR_KEY_inhibit_desktop_hibernation_kebab: return TR_KEY_inhibit_desktop_hibernation;
|
||||
case TR_KEY_is_backup_camel: return TR_KEY_is_backup;
|
||||
case TR_KEY_is_downloading_from_camel: return TR_KEY_is_downloading_from;
|
||||
case TR_KEY_is_encrypted_camel: return TR_KEY_is_encrypted;
|
||||
case TR_KEY_is_finished_camel: return TR_KEY_is_finished;
|
||||
case TR_KEY_is_incoming_camel: return TR_KEY_is_incoming;
|
||||
case TR_KEY_is_private_camel: return TR_KEY_is_private;
|
||||
case TR_KEY_is_stalled_camel: return TR_KEY_is_stalled;
|
||||
case TR_KEY_is_uploading_to_camel: return TR_KEY_is_uploading_to;
|
||||
case TR_KEY_is_utp_camel: return TR_KEY_is_utp;
|
||||
case TR_KEY_last_announce_peer_count_camel: return TR_KEY_last_announce_peer_count;
|
||||
case TR_KEY_last_announce_result_camel: return TR_KEY_last_announce_result;
|
||||
case TR_KEY_last_announce_start_time_camel: return TR_KEY_last_announce_start_time;
|
||||
case TR_KEY_last_announce_succeeded_camel: return TR_KEY_last_announce_succeeded;
|
||||
case TR_KEY_last_announce_time_camel: return TR_KEY_last_announce_time;
|
||||
case TR_KEY_last_announce_timed_out_camel: return TR_KEY_last_announce_timed_out;
|
||||
case TR_KEY_last_scrape_result_camel: return TR_KEY_last_scrape_result;
|
||||
case TR_KEY_last_scrape_start_time_camel: return TR_KEY_last_scrape_start_time;
|
||||
case TR_KEY_last_scrape_succeeded_camel: return TR_KEY_last_scrape_succeeded;
|
||||
case TR_KEY_last_scrape_time_camel: return TR_KEY_last_scrape_time;
|
||||
case TR_KEY_last_scrape_timed_out_camel: return TR_KEY_last_scrape_timed_out;
|
||||
case TR_KEY_leecher_count_camel: return TR_KEY_leecher_count;
|
||||
case TR_KEY_left_until_done_camel: return TR_KEY_left_until_done;
|
||||
case TR_KEY_lpd_enabled_kebab: return TR_KEY_lpd_enabled;
|
||||
case TR_KEY_magnet_link_camel: return TR_KEY_magnet_link;
|
||||
case TR_KEY_main_window_height_kebab: return TR_KEY_main_window_height;
|
||||
case TR_KEY_main_window_is_maximized_kebab: return TR_KEY_main_window_is_maximized;
|
||||
case TR_KEY_main_window_layout_order_kebab: return TR_KEY_main_window_layout_order;
|
||||
case TR_KEY_main_window_width_kebab: return TR_KEY_main_window_width;
|
||||
case TR_KEY_main_window_x_kebab: return TR_KEY_main_window_x;
|
||||
case TR_KEY_main_window_y_kebab: return TR_KEY_main_window_y;
|
||||
case TR_KEY_manual_announce_time_camel: return TR_KEY_manual_announce_time;
|
||||
case TR_KEY_max_connected_peers_camel: return TR_KEY_max_connected_peers;
|
||||
case TR_KEY_max_peers_kebab: return TR_KEY_max_peers;
|
||||
case TR_KEY_memory_bytes_kebab: return TR_KEY_memory_bytes;
|
||||
case TR_KEY_memory_units_kebab: return TR_KEY_memory_units;
|
||||
case TR_KEY_message_level_kebab: return TR_KEY_message_level;
|
||||
case TR_KEY_metadata_percent_complete_camel: return TR_KEY_metadata_percent_complete;
|
||||
case TR_KEY_next_announce_time_camel: return TR_KEY_next_announce_time;
|
||||
case TR_KEY_next_scrape_time_camel: return TR_KEY_next_scrape_time;
|
||||
case TR_KEY_open_dialog_dir_kebab: return TR_KEY_open_dialog_dir;
|
||||
case TR_KEY_paused_torrent_count_camel: return TR_KEY_paused_torrent_count;
|
||||
case TR_KEY_peer_congestion_algorithm_kebab: return TR_KEY_peer_congestion_algorithm;
|
||||
case TR_KEY_peer_is_choked_camel: return TR_KEY_peer_is_choked;
|
||||
case TR_KEY_peer_is_interested_camel: return TR_KEY_peer_is_interested;
|
||||
case TR_KEY_peer_limit_kebab: return TR_KEY_peer_limit;
|
||||
case TR_KEY_peer_limit_global_kebab: return TR_KEY_peer_limit_global;
|
||||
case TR_KEY_peer_limit_per_torrent_kebab: return TR_KEY_peer_limit_per_torrent;
|
||||
case TR_KEY_peer_port_kebab: return TR_KEY_peer_port;
|
||||
case TR_KEY_peer_port_random_high_kebab: return TR_KEY_peer_port_random_high;
|
||||
case TR_KEY_peer_port_random_low_kebab: return TR_KEY_peer_port_random_low;
|
||||
case TR_KEY_peer_port_random_on_start_kebab: return TR_KEY_peer_port_random_on_start;
|
||||
case TR_KEY_peer_socket_tos_kebab: return TR_KEY_peer_socket_tos;
|
||||
case TR_KEY_peers2_6_kebab: return TR_KEY_peers2_6;
|
||||
case TR_KEY_peers_connected_camel: return TR_KEY_peers_connected;
|
||||
case TR_KEY_peers_from_camel: return TR_KEY_peers_from;
|
||||
case TR_KEY_peers_getting_from_us_camel: return TR_KEY_peers_getting_from_us;
|
||||
case TR_KEY_peers_sending_to_us_camel: return TR_KEY_peers_sending_to_us;
|
||||
case TR_KEY_percent_complete_camel: return TR_KEY_percent_complete;
|
||||
case TR_KEY_percent_done_camel: return TR_KEY_percent_done;
|
||||
case TR_KEY_pex_enabled_kebab: return TR_KEY_pex_enabled;
|
||||
case TR_KEY_piece_count_camel: return TR_KEY_piece_count;
|
||||
case TR_KEY_piece_size_camel: return TR_KEY_piece_size;
|
||||
case TR_KEY_port_forwarding_enabled_kebab: return TR_KEY_port_forwarding_enabled;
|
||||
case TR_KEY_port_is_open_kebab: return TR_KEY_port_is_open;
|
||||
case TR_KEY_primary_mime_type_kebab: return TR_KEY_primary_mime_type;
|
||||
case TR_KEY_priority_high_kebab: return TR_KEY_priority_high;
|
||||
case TR_KEY_priority_low_kebab: return TR_KEY_priority_low;
|
||||
case TR_KEY_priority_normal_kebab: return TR_KEY_priority_normal;
|
||||
case TR_KEY_prompt_before_exit_kebab: return TR_KEY_prompt_before_exit;
|
||||
case TR_KEY_queue_position_camel: return TR_KEY_queue_position;
|
||||
case TR_KEY_queue_stalled_enabled_kebab: return TR_KEY_queue_stalled_enabled;
|
||||
case TR_KEY_queue_stalled_minutes_kebab: return TR_KEY_queue_stalled_minutes;
|
||||
case TR_KEY_rate_download_camel: return TR_KEY_rate_download;
|
||||
case TR_KEY_rate_to_client_camel: return TR_KEY_rate_to_client;
|
||||
case TR_KEY_rate_to_peer_camel: return TR_KEY_rate_to_peer;
|
||||
case TR_KEY_rate_upload_camel: return TR_KEY_rate_upload;
|
||||
case TR_KEY_ratio_limit_kebab: return TR_KEY_ratio_limit;
|
||||
case TR_KEY_ratio_limit_enabled_kebab: return TR_KEY_ratio_limit_enabled;
|
||||
case TR_KEY_ratio_mode_kebab: return TR_KEY_ratio_mode;
|
||||
case TR_KEY_read_clipboard_kebab: return TR_KEY_read_clipboard;
|
||||
case TR_KEY_recheck_progress_camel: return TR_KEY_recheck_progress;
|
||||
case TR_KEY_remote_session_enabled_kebab: return TR_KEY_remote_session_enabled;
|
||||
case TR_KEY_remote_session_host_kebab: return TR_KEY_remote_session_host;
|
||||
case TR_KEY_remote_session_https_kebab: return TR_KEY_remote_session_https;
|
||||
case TR_KEY_remote_session_password_kebab: return TR_KEY_remote_session_password;
|
||||
case TR_KEY_remote_session_port_kebab: return TR_KEY_remote_session_port;
|
||||
case TR_KEY_remote_session_requres_authentication_kebab: return TR_KEY_remote_session_requires_authentication;
|
||||
case TR_KEY_remote_session_username_kebab: return TR_KEY_remote_session_username;
|
||||
case TR_KEY_rename_partial_files_kebab: return TR_KEY_rename_partial_files;
|
||||
case TR_KEY_rpc_authentication_required_kebab: return TR_KEY_rpc_authentication_required;
|
||||
case TR_KEY_rpc_bind_address_kebab: return TR_KEY_rpc_bind_address;
|
||||
case TR_KEY_rpc_enabled_kebab: return TR_KEY_rpc_enabled;
|
||||
case TR_KEY_rpc_host_whitelist_kebab: return TR_KEY_rpc_host_whitelist;
|
||||
case TR_KEY_rpc_host_whitelist_enabled_kebab: return TR_KEY_rpc_host_whitelist_enabled;
|
||||
case TR_KEY_rpc_password_kebab: return TR_KEY_rpc_password;
|
||||
case TR_KEY_rpc_port_kebab: return TR_KEY_rpc_port;
|
||||
case TR_KEY_rpc_socket_mode_kebab: return TR_KEY_rpc_socket_mode;
|
||||
case TR_KEY_rpc_url_kebab: return TR_KEY_rpc_url;
|
||||
case TR_KEY_rpc_username_kebab: return TR_KEY_rpc_username;
|
||||
case TR_KEY_rpc_version_kebab: return TR_KEY_rpc_version;
|
||||
case TR_KEY_rpc_version_minimum_kebab: return TR_KEY_rpc_version_minimum;
|
||||
case TR_KEY_rpc_version_semver_kebab: return TR_KEY_rpc_version_semver;
|
||||
case TR_KEY_rpc_whitelist_kebab: return TR_KEY_rpc_whitelist;
|
||||
case TR_KEY_rpc_whitelist_enabled_kebab: return TR_KEY_rpc_whitelist_enabled;
|
||||
case TR_KEY_seconds_downloading_camel: return TR_KEY_seconds_downloading;
|
||||
case TR_KEY_scrape_paused_torrents_enabled_kebab: return TR_KEY_scrape_paused_torrents_enabled;
|
||||
case TR_KEY_scrape_state_camel: return TR_KEY_scrape_state;
|
||||
case TR_KEY_script_torrent_added_enabled_kebab: return TR_KEY_script_torrent_added_enabled;
|
||||
case TR_KEY_script_torrent_added_filename_kebab: return TR_KEY_script_torrent_added_filename;
|
||||
case TR_KEY_script_torrent_done_enabled_kebab: return TR_KEY_script_torrent_done_enabled;
|
||||
case TR_KEY_script_torrent_done_filename_kebab: return TR_KEY_script_torrent_done_filename;
|
||||
case TR_KEY_script_torrent_done_seeding_enabled_kebab: return TR_KEY_script_torrent_done_seeding_enabled;
|
||||
case TR_KEY_script_torrent_done_seeding_filename_kebab: return TR_KEY_script_torrent_done_seeding_filename;
|
||||
case TR_KEY_seconds_active_camel:
|
||||
case TR_KEY_seconds_active_kebab:
|
||||
return TR_KEY_seconds_active;
|
||||
case TR_KEY_seconds_seeding_camel: return TR_KEY_seconds_seeding;
|
||||
case TR_KEY_seed_idle_limit_camel: return TR_KEY_seed_idle_limit;
|
||||
case TR_KEY_seed_idle_mode_camel: return TR_KEY_seed_idle_mode;
|
||||
case TR_KEY_seed_queue_enabled_kebab: return TR_KEY_seed_queue_enabled;
|
||||
case TR_KEY_seed_queue_size_kebab: return TR_KEY_seed_queue_size;
|
||||
case TR_KEY_seed_ratio_limit_camel: return TR_KEY_seed_ratio_limit;
|
||||
case TR_KEY_seed_ratio_limited_camel: return TR_KEY_seed_ratio_limited;
|
||||
case TR_KEY_seed_ratio_mode_camel: return TR_KEY_seed_ratio_mode;
|
||||
case TR_KEY_seeding_time_seconds_kebab: return TR_KEY_seeding_time_seconds;
|
||||
case TR_KEY_seeder_count_camel: return TR_KEY_seeder_count;
|
||||
case TR_KEY_session_count_camel:
|
||||
case TR_KEY_session_count_kebab:
|
||||
return TR_KEY_session_count;
|
||||
case TR_KEY_session_id_kebab: return TR_KEY_session_id;
|
||||
case TR_KEY_show_backup_trackers_kebab: return TR_KEY_show_backup_trackers;
|
||||
case TR_KEY_show_extra_peer_details_kebab: return TR_KEY_show_extra_peer_details;
|
||||
case TR_KEY_show_filterbar_kebab: return TR_KEY_show_filterbar;
|
||||
case TR_KEY_show_notification_area_icon_kebab: return TR_KEY_show_notification_area_icon;
|
||||
case TR_KEY_show_options_window_kebab: return TR_KEY_show_options_window;
|
||||
case TR_KEY_show_statusbar_kebab: return TR_KEY_show_statusbar;
|
||||
case TR_KEY_show_toolbar_kebab: return TR_KEY_show_toolbar;
|
||||
case TR_KEY_show_tracker_scrapes_kebab: return TR_KEY_show_tracker_scrapes;
|
||||
case TR_KEY_size_bytes_kebab: return TR_KEY_size_bytes;
|
||||
case TR_KEY_size_units_kebab: return TR_KEY_size_units;
|
||||
case TR_KEY_size_when_done_camel: return TR_KEY_size_when_done;
|
||||
case TR_KEY_sort_mode_kebab: return TR_KEY_sort_mode;
|
||||
case TR_KEY_sort_reversed_kebab: return TR_KEY_sort_reversed;
|
||||
case TR_KEY_speed_Bps_kebab: return TR_KEY_speed_Bps;
|
||||
case TR_KEY_speed_bytes_kebab: return TR_KEY_speed_bytes;
|
||||
case TR_KEY_speed_limit_down_kebab: return TR_KEY_speed_limit_down;
|
||||
case TR_KEY_speed_limit_down_enabled_kebab: return TR_KEY_speed_limit_down_enabled;
|
||||
case TR_KEY_speed_limit_up_kebab: return TR_KEY_speed_limit_up;
|
||||
case TR_KEY_speed_limit_up_enabled_kebab: return TR_KEY_speed_limit_up_enabled;
|
||||
case TR_KEY_speed_units_kebab: return TR_KEY_speed_units;
|
||||
case TR_KEY_start_added_torrents_kebab: return TR_KEY_start_added_torrents;
|
||||
case TR_KEY_start_date_camel: return TR_KEY_start_date;
|
||||
case TR_KEY_start_minimized_kebab: return TR_KEY_start_minimized;
|
||||
case TR_KEY_statusbar_stats_kebab: return TR_KEY_statusbar_stats;
|
||||
case TR_KEY_tcp_enabled_kebab: return TR_KEY_tcp_enabled;
|
||||
case TR_KEY_torrent_added_kebab: return TR_KEY_torrent_added;
|
||||
case TR_KEY_torrent_added_notification_enabled_kebab: return TR_KEY_torrent_added_notification_enabled;
|
||||
case TR_KEY_torrent_added_verify_mode_kebab: return TR_KEY_torrent_added_verify_mode;
|
||||
case TR_KEY_torrent_complete_notification_enabled_kebab: return TR_KEY_torrent_complete_notification_enabled;
|
||||
case TR_KEY_torrent_complete_sound_command_kebab: return TR_KEY_torrent_complete_sound_command;
|
||||
case TR_KEY_torrent_complete_sound_enabled_kebab: return TR_KEY_torrent_complete_sound_enabled;
|
||||
case TR_KEY_torrent_count_camel: return TR_KEY_torrent_count;
|
||||
case TR_KEY_torrent_duplicate_kebab: return TR_KEY_torrent_duplicate;
|
||||
case TR_KEY_torrent_file_camel: return TR_KEY_torrent_file;
|
||||
case TR_KEY_torrent_get_kebab: return TR_KEY_torrent_get;
|
||||
case TR_KEY_torrent_set_kebab: return TR_KEY_torrent_set;
|
||||
case TR_KEY_torrent_set_location_kebab: return TR_KEY_torrent_set_location;
|
||||
case TR_KEY_total_size_camel: return TR_KEY_total_size;
|
||||
case TR_KEY_tracker_add_camel: return TR_KEY_tracker_add;
|
||||
case TR_KEY_tracker_list_camel: return TR_KEY_tracker_list;
|
||||
case TR_KEY_tracker_remove_camel: return TR_KEY_tracker_remove;
|
||||
case TR_KEY_tracker_replace_camel: return TR_KEY_tracker_replace;
|
||||
case TR_KEY_tracker_stats_camel: return TR_KEY_tracker_stats;
|
||||
case TR_KEY_trash_can_enabled_kebab: return TR_KEY_trash_can_enabled;
|
||||
case TR_KEY_trash_original_torrent_files_kebab: return TR_KEY_trash_original_torrent_files;
|
||||
case TR_KEY_upload_limit_camel: return TR_KEY_upload_limit;
|
||||
case TR_KEY_upload_limited_camel: return TR_KEY_upload_limited;
|
||||
case TR_KEY_upload_slots_per_torrent_kebab: return TR_KEY_upload_slots_per_torrent;
|
||||
case TR_KEY_upload_ratio_camel: return TR_KEY_upload_ratio;
|
||||
case TR_KEY_upload_speed_camel: return TR_KEY_upload_speed;
|
||||
case TR_KEY_uploaded_bytes_camel:
|
||||
case TR_KEY_uploaded_bytes_kebab:
|
||||
return TR_KEY_uploaded_bytes;
|
||||
case TR_KEY_uploaded_ever_camel: return TR_KEY_uploaded_ever;
|
||||
case TR_KEY_use_global_speed_limit_kebab: return TR_KEY_use_global_speed_limit;
|
||||
case TR_KEY_use_speed_limit_kebab: return TR_KEY_use_speed_limit;
|
||||
case TR_KEY_user_has_given_informed_consent_kebab: return TR_KEY_user_has_given_informed_consent;
|
||||
case TR_KEY_utp_enabled_kebab: return TR_KEY_utp_enabled;
|
||||
case TR_KEY_watch_dir_kebab: return TR_KEY_watch_dir;
|
||||
case TR_KEY_watch_dir_enabled_kebab: return TR_KEY_watch_dir_enabled;
|
||||
case TR_KEY_watch_dir_force_generic_kebab: return TR_KEY_watch_dir_force_generic;
|
||||
case TR_KEY_webseeds_sending_to_us_camel: return TR_KEY_webseeds_sending_to_us;
|
||||
default: return q;
|
||||
}
|
||||
// clang-format on
|
||||
}
|
||||
|
||||
@@ -14,24 +14,30 @@ using tr_quark = size_t;
|
||||
|
||||
/*
|
||||
* Predefined Quarks.
|
||||
*
|
||||
* TODO: it would be nice to clean up all the naming inconsistencies
|
||||
* between RPC and settings. This will be a mess and we shouldn't be
|
||||
* in a hurry to do it.
|
||||
*/
|
||||
enum // NOLINT(performance-enum-size)
|
||||
{
|
||||
TR_KEY_NONE, /* represented as an empty string */
|
||||
TR_KEY_activeTorrentCount, /* rpc */
|
||||
TR_KEY_activity_date, /* resume file */
|
||||
TR_KEY_activityDate, /* rpc */
|
||||
TR_KEY_active_torrent_count_camel, /* rpc (deprecated) */
|
||||
TR_KEY_active_torrent_count, /* rpc */
|
||||
TR_KEY_activity_date_kebab, /* resume file (legacy) */
|
||||
TR_KEY_activity_date_camel, /* rpc (deprecated) */
|
||||
TR_KEY_activity_date, /* rpc, resume file */
|
||||
TR_KEY_added, /* pex */
|
||||
TR_KEY_added_date, /* rpc */
|
||||
TR_KEY_added_date_kebab, /* resume file (legacy) */
|
||||
TR_KEY_added_f, /* pex */
|
||||
TR_KEY_added6, /* pex */
|
||||
TR_KEY_added6_f, /* pex */
|
||||
TR_KEY_addedDate, /* rpc */
|
||||
TR_KEY_added_date_camel, /* rpc (deprecated) */
|
||||
TR_KEY_added_date, /* rpc, resume file */
|
||||
TR_KEY_address, /* rpc */
|
||||
TR_KEY_alt_speed_down_kebab, /* rpc, settings (deprecated) */
|
||||
TR_KEY_alt_speed_enabled_kebab, /* rpc, settings (deprecated) */
|
||||
TR_KEY_alt_speed_time_begin_kebab, /* rpc, settings (deprecated) */
|
||||
TR_KEY_alt_speed_time_day_kebab, /* rpc, settings (deprecated) */
|
||||
TR_KEY_alt_speed_time_enabled_kebab, /* rpc, settings (deprecated) */
|
||||
TR_KEY_alt_speed_time_end_kebab, /* rpc, settings (deprecated) */
|
||||
TR_KEY_alt_speed_up_kebab, /* rpc, settings (deprecated) */
|
||||
TR_KEY_alt_speed_down, /* rpc, settings */
|
||||
TR_KEY_alt_speed_enabled, /* rpc, settings */
|
||||
TR_KEY_alt_speed_time_begin, /* rpc, settings */
|
||||
@@ -40,174 +46,285 @@ enum // NOLINT(performance-enum-size)
|
||||
TR_KEY_alt_speed_time_end, /* rpc, settings */
|
||||
TR_KEY_alt_speed_up, /* rpc, settings */
|
||||
TR_KEY_announce, /* metainfo */
|
||||
TR_KEY_announce_ip, /* metainfo, settings */
|
||||
TR_KEY_announce_ip_enabled, /* metainfo, settings */
|
||||
TR_KEY_announce_ip_kebab, /* settings (legacy) */
|
||||
TR_KEY_announce_ip_enabled_kebab, /* settings (legacy) */
|
||||
TR_KEY_announce_list, /* metainfo */
|
||||
TR_KEY_announceState, /* rpc */
|
||||
TR_KEY_anti_brute_force_enabled, /* rpc */
|
||||
TR_KEY_anti_brute_force_threshold, /* rpc */
|
||||
TR_KEY_announce_state_camel, /* rpc (deprecated) */
|
||||
TR_KEY_announce_ip, /* settings */
|
||||
TR_KEY_announce_ip_enabled, /* settings */
|
||||
TR_KEY_announce_state, /* rpc */
|
||||
TR_KEY_anti_brute_force_enabled_kebab, /* rpc, settings (deprecated) */
|
||||
TR_KEY_anti_brute_force_threshold_kebab, /* rpc, settings (deprecated) */
|
||||
TR_KEY_anti_brute_force_enabled, /* rpc, settings */
|
||||
TR_KEY_anti_brute_force_threshold, /* rpc, settings */
|
||||
TR_KEY_arguments, /* rpc */
|
||||
TR_KEY_availability, // rpc
|
||||
TR_KEY_bandwidth_priority_kebab,
|
||||
TR_KEY_bandwidth_priority_camel,
|
||||
TR_KEY_bandwidth_priority,
|
||||
TR_KEY_bandwidthPriority,
|
||||
TR_KEY_begin_piece,
|
||||
TR_KEY_bind_address_ipv4_kebab,
|
||||
TR_KEY_bind_address_ipv6_kebab,
|
||||
TR_KEY_bind_address_ipv4,
|
||||
TR_KEY_bind_address_ipv6,
|
||||
TR_KEY_bitfield,
|
||||
TR_KEY_blocklist_date_kebab,
|
||||
TR_KEY_blocklist_enabled_kebab,
|
||||
TR_KEY_blocklist_size_kebab,
|
||||
TR_KEY_blocklist_updates_enabled_kebab,
|
||||
TR_KEY_blocklist_url_kebab,
|
||||
TR_KEY_blocklist_date,
|
||||
TR_KEY_blocklist_enabled,
|
||||
TR_KEY_blocklist_size,
|
||||
TR_KEY_blocklist_updates_enabled,
|
||||
TR_KEY_blocklist_url,
|
||||
TR_KEY_blocks,
|
||||
TR_KEY_bytesCompleted,
|
||||
TR_KEY_bytes_completed_camel,
|
||||
TR_KEY_bytes_completed,
|
||||
TR_KEY_bytes_to_client,
|
||||
TR_KEY_bytes_to_peer,
|
||||
TR_KEY_cache_size_mb_kebab,
|
||||
TR_KEY_cache_size_mb,
|
||||
TR_KEY_clientIsChoked,
|
||||
TR_KEY_clientIsInterested,
|
||||
TR_KEY_clientName,
|
||||
TR_KEY_client_is_choked_camel,
|
||||
TR_KEY_client_is_interested_camel,
|
||||
TR_KEY_client_name_camel,
|
||||
TR_KEY_client_is_choked,
|
||||
TR_KEY_client_is_interested,
|
||||
TR_KEY_client_name,
|
||||
TR_KEY_code,
|
||||
TR_KEY_comment,
|
||||
TR_KEY_compact_view_kebab,
|
||||
TR_KEY_compact_view,
|
||||
TR_KEY_complete,
|
||||
TR_KEY_config_dir_kebab,
|
||||
TR_KEY_config_dir,
|
||||
TR_KEY_cookies,
|
||||
TR_KEY_corrupt,
|
||||
TR_KEY_corruptEver,
|
||||
TR_KEY_corrupt_ever_camel,
|
||||
TR_KEY_corrupt_ever,
|
||||
TR_KEY_created_by,
|
||||
TR_KEY_creation_date,
|
||||
TR_KEY_creator,
|
||||
TR_KEY_cumulative_stats_kebab,
|
||||
TR_KEY_cumulative_stats,
|
||||
TR_KEY_current_stats_kebab,
|
||||
TR_KEY_current_stats,
|
||||
TR_KEY_data,
|
||||
TR_KEY_date,
|
||||
TR_KEY_dateCreated,
|
||||
TR_KEY_date_created_camel,
|
||||
TR_KEY_date_created,
|
||||
TR_KEY_default_trackers_kebab,
|
||||
TR_KEY_default_trackers,
|
||||
TR_KEY_delete_local_data_kebab,
|
||||
TR_KEY_delete_local_data,
|
||||
TR_KEY_desiredAvailable,
|
||||
TR_KEY_desired_available_camel,
|
||||
TR_KEY_desired_available,
|
||||
TR_KEY_destination,
|
||||
TR_KEY_details_window_height_kebab,
|
||||
TR_KEY_details_window_width_kebab,
|
||||
TR_KEY_details_window_height,
|
||||
TR_KEY_details_window_width,
|
||||
TR_KEY_dht_enabled_kebab,
|
||||
TR_KEY_dht_enabled,
|
||||
TR_KEY_dnd,
|
||||
TR_KEY_done_date_kebab,
|
||||
TR_KEY_done_date_camel,
|
||||
TR_KEY_done_date,
|
||||
TR_KEY_doneDate,
|
||||
TR_KEY_download_dir_kebab,
|
||||
TR_KEY_download_dir_free_space_kebab,
|
||||
TR_KEY_download_queue_enabled_kebab,
|
||||
TR_KEY_download_queue_size_kebab,
|
||||
TR_KEY_download_count_camel,
|
||||
TR_KEY_download_dir_camel,
|
||||
TR_KEY_download_limit_camel,
|
||||
TR_KEY_download_limited_camel,
|
||||
TR_KEY_download_speed_camel,
|
||||
TR_KEY_download_count,
|
||||
TR_KEY_download_dir,
|
||||
TR_KEY_download_dir_free_space,
|
||||
TR_KEY_download_limit,
|
||||
TR_KEY_download_limited,
|
||||
TR_KEY_download_queue_enabled,
|
||||
TR_KEY_download_queue_size,
|
||||
TR_KEY_downloadCount,
|
||||
TR_KEY_downloadDir,
|
||||
TR_KEY_downloadLimit,
|
||||
TR_KEY_downloadLimited,
|
||||
TR_KEY_downloadSpeed,
|
||||
TR_KEY_download_speed,
|
||||
TR_KEY_downloaded,
|
||||
TR_KEY_downloaded_bytes_kebab,
|
||||
TR_KEY_downloaded_bytes_camel,
|
||||
TR_KEY_downloaded_ever_camel,
|
||||
TR_KEY_downloaded_bytes,
|
||||
TR_KEY_downloadedBytes,
|
||||
TR_KEY_downloadedEver,
|
||||
TR_KEY_downloaded_ever,
|
||||
TR_KEY_downloader_count,
|
||||
TR_KEY_downloading_time_seconds_kebab,
|
||||
TR_KEY_downloading_time_seconds,
|
||||
TR_KEY_dropped,
|
||||
TR_KEY_dropped6,
|
||||
TR_KEY_e,
|
||||
TR_KEY_editDate,
|
||||
TR_KEY_edit_date_camel,
|
||||
TR_KEY_edit_date,
|
||||
TR_KEY_encoding,
|
||||
TR_KEY_encryption,
|
||||
TR_KEY_end_piece,
|
||||
TR_KEY_error,
|
||||
TR_KEY_errorString,
|
||||
TR_KEY_error_string_camel,
|
||||
TR_KEY_error_string,
|
||||
TR_KEY_eta,
|
||||
TR_KEY_etaIdle,
|
||||
TR_KEY_eta_idle_camel,
|
||||
TR_KEY_eta_idle,
|
||||
TR_KEY_fields,
|
||||
TR_KEY_file_count_kebab,
|
||||
TR_KEY_file_stats_camel,
|
||||
TR_KEY_file_count,
|
||||
TR_KEY_fileStats,
|
||||
TR_KEY_file_stats,
|
||||
TR_KEY_filename,
|
||||
TR_KEY_files,
|
||||
TR_KEY_files_added_kebab,
|
||||
TR_KEY_files_unwanted_kebab,
|
||||
TR_KEY_files_wanted_kebab,
|
||||
TR_KEY_files_added_camel,
|
||||
TR_KEY_files_added,
|
||||
TR_KEY_files_unwanted,
|
||||
TR_KEY_files_wanted,
|
||||
TR_KEY_filesAdded,
|
||||
TR_KEY_filter_mode_kebab,
|
||||
TR_KEY_filter_text_kebab,
|
||||
TR_KEY_filter_trackers_kebab,
|
||||
TR_KEY_filter_mode,
|
||||
TR_KEY_filter_text,
|
||||
TR_KEY_filter_trackers,
|
||||
TR_KEY_flagStr,
|
||||
TR_KEY_flag_str_camel,
|
||||
TR_KEY_flag_str,
|
||||
TR_KEY_flags,
|
||||
TR_KEY_format,
|
||||
TR_KEY_fromCache,
|
||||
TR_KEY_fromDht,
|
||||
TR_KEY_fromIncoming,
|
||||
TR_KEY_fromLpd,
|
||||
TR_KEY_fromLtep,
|
||||
TR_KEY_fromPex,
|
||||
TR_KEY_fromTracker,
|
||||
TR_KEY_from_cache_camel,
|
||||
TR_KEY_from_dht_camel,
|
||||
TR_KEY_from_incoming_camel,
|
||||
TR_KEY_from_lpd_camel,
|
||||
TR_KEY_from_ltep_camel,
|
||||
TR_KEY_from_pex_camel,
|
||||
TR_KEY_from_tracker_camel,
|
||||
TR_KEY_from_cache,
|
||||
TR_KEY_from_dht,
|
||||
TR_KEY_from_incoming,
|
||||
TR_KEY_from_lpd,
|
||||
TR_KEY_from_ltep,
|
||||
TR_KEY_from_pex,
|
||||
TR_KEY_from_tracker,
|
||||
TR_KEY_group,
|
||||
TR_KEY_hasAnnounced,
|
||||
TR_KEY_hasScraped,
|
||||
TR_KEY_hashString,
|
||||
TR_KEY_has_announced_camel,
|
||||
TR_KEY_has_scraped_camel,
|
||||
TR_KEY_has_announced,
|
||||
TR_KEY_has_scraped,
|
||||
TR_KEY_hash_string_camel,
|
||||
TR_KEY_hash_string,
|
||||
TR_KEY_have,
|
||||
TR_KEY_haveUnchecked,
|
||||
TR_KEY_haveValid,
|
||||
TR_KEY_honorsSessionLimits,
|
||||
TR_KEY_have_unchecked_camel,
|
||||
TR_KEY_have_valid_camel,
|
||||
TR_KEY_have_unchecked,
|
||||
TR_KEY_have_valid,
|
||||
TR_KEY_honors_session_limits_camel,
|
||||
TR_KEY_honors_session_limits,
|
||||
TR_KEY_host,
|
||||
TR_KEY_id,
|
||||
TR_KEY_id_timestamp,
|
||||
TR_KEY_idle_limit_kebab,
|
||||
TR_KEY_idle_mode_kebab,
|
||||
TR_KEY_idle_seeding_limit_kebab,
|
||||
TR_KEY_idle_seeding_limit_enabled_kebab,
|
||||
TR_KEY_idle_limit,
|
||||
TR_KEY_idle_mode,
|
||||
TR_KEY_idle_seeding_limit,
|
||||
TR_KEY_idle_seeding_limit_enabled,
|
||||
TR_KEY_ids,
|
||||
TR_KEY_incomplete,
|
||||
TR_KEY_incomplete_dir_kebab,
|
||||
TR_KEY_incomplete_dir_enabled_kebab,
|
||||
TR_KEY_incomplete_dir,
|
||||
TR_KEY_incomplete_dir_enabled,
|
||||
TR_KEY_info,
|
||||
TR_KEY_inhibit_desktop_hibernation_kebab,
|
||||
TR_KEY_inhibit_desktop_hibernation,
|
||||
TR_KEY_ip_protocol,
|
||||
TR_KEY_ipv4,
|
||||
TR_KEY_ipv6,
|
||||
TR_KEY_isBackup,
|
||||
TR_KEY_isDownloadingFrom,
|
||||
TR_KEY_isEncrypted,
|
||||
TR_KEY_isFinished,
|
||||
TR_KEY_isIncoming,
|
||||
TR_KEY_isPrivate,
|
||||
TR_KEY_isStalled,
|
||||
TR_KEY_isUTP,
|
||||
TR_KEY_isUploadingTo,
|
||||
TR_KEY_is_backup_camel,
|
||||
TR_KEY_is_downloading_from_camel,
|
||||
TR_KEY_is_encrypted_camel,
|
||||
TR_KEY_is_finished_camel,
|
||||
TR_KEY_is_incoming_camel,
|
||||
TR_KEY_is_private_camel,
|
||||
TR_KEY_is_stalled_camel,
|
||||
TR_KEY_is_utp_camel,
|
||||
TR_KEY_is_uploading_to_camel,
|
||||
TR_KEY_is_backup,
|
||||
TR_KEY_is_downloading_from,
|
||||
TR_KEY_is_encrypted,
|
||||
TR_KEY_is_finished,
|
||||
TR_KEY_is_incoming,
|
||||
TR_KEY_is_private,
|
||||
TR_KEY_is_stalled,
|
||||
TR_KEY_is_uploading_to,
|
||||
TR_KEY_is_utp,
|
||||
TR_KEY_jsonrpc,
|
||||
TR_KEY_labels,
|
||||
TR_KEY_lastAnnouncePeerCount,
|
||||
TR_KEY_lastAnnounceResult,
|
||||
TR_KEY_lastAnnounceStartTime,
|
||||
TR_KEY_lastAnnounceSucceeded,
|
||||
TR_KEY_lastAnnounceTime,
|
||||
TR_KEY_lastAnnounceTimedOut,
|
||||
TR_KEY_lastScrapeResult,
|
||||
TR_KEY_lastScrapeStartTime,
|
||||
TR_KEY_lastScrapeSucceeded,
|
||||
TR_KEY_lastScrapeTime,
|
||||
TR_KEY_lastScrapeTimedOut,
|
||||
TR_KEY_leecherCount,
|
||||
TR_KEY_leftUntilDone,
|
||||
TR_KEY_last_announce_peer_count_camel,
|
||||
TR_KEY_last_announce_result_camel,
|
||||
TR_KEY_last_announce_start_time_camel,
|
||||
TR_KEY_last_announce_succeeded_camel,
|
||||
TR_KEY_last_announce_time_camel,
|
||||
TR_KEY_last_announce_timed_out_camel,
|
||||
TR_KEY_last_scrape_result_camel,
|
||||
TR_KEY_last_scrape_start_time_camel,
|
||||
TR_KEY_last_scrape_succeeded_camel,
|
||||
TR_KEY_last_scrape_time_camel,
|
||||
TR_KEY_last_scrape_timed_out_camel,
|
||||
TR_KEY_last_announce_peer_count,
|
||||
TR_KEY_last_announce_result,
|
||||
TR_KEY_last_announce_start_time,
|
||||
TR_KEY_last_announce_succeeded,
|
||||
TR_KEY_last_announce_time,
|
||||
TR_KEY_last_announce_timed_out,
|
||||
TR_KEY_last_scrape_result,
|
||||
TR_KEY_last_scrape_start_time,
|
||||
TR_KEY_last_scrape_succeeded,
|
||||
TR_KEY_last_scrape_time,
|
||||
TR_KEY_last_scrape_timed_out,
|
||||
TR_KEY_leecher_count_camel,
|
||||
TR_KEY_leecher_count,
|
||||
TR_KEY_left_until_done_camel,
|
||||
TR_KEY_left_until_done,
|
||||
TR_KEY_length,
|
||||
TR_KEY_location,
|
||||
TR_KEY_lpd_enabled_kebab,
|
||||
TR_KEY_lpd_enabled,
|
||||
TR_KEY_m,
|
||||
TR_KEY_magnetLink,
|
||||
TR_KEY_magnet_link_camel,
|
||||
TR_KEY_magnet_link,
|
||||
TR_KEY_main_window_height_kebab,
|
||||
TR_KEY_main_window_is_maximized_kebab,
|
||||
TR_KEY_main_window_layout_order_kebab,
|
||||
TR_KEY_main_window_width_kebab,
|
||||
TR_KEY_main_window_x_kebab,
|
||||
TR_KEY_main_window_y_kebab,
|
||||
TR_KEY_main_window_height,
|
||||
TR_KEY_main_window_is_maximized,
|
||||
TR_KEY_main_window_layout_order,
|
||||
TR_KEY_main_window_width,
|
||||
TR_KEY_main_window_x,
|
||||
TR_KEY_main_window_y,
|
||||
TR_KEY_manualAnnounceTime,
|
||||
TR_KEY_manual_announce_time_camel,
|
||||
TR_KEY_manual_announce_time,
|
||||
TR_KEY_max_peers_kebab,
|
||||
TR_KEY_max_connected_peers_camel,
|
||||
TR_KEY_max_connected_peers,
|
||||
TR_KEY_max_peers,
|
||||
TR_KEY_maxConnectedPeers,
|
||||
TR_KEY_memory_bytes_kebab,
|
||||
TR_KEY_memory_units_kebab,
|
||||
TR_KEY_memory_bytes,
|
||||
TR_KEY_memory_units,
|
||||
TR_KEY_message,
|
||||
TR_KEY_message_level_kebab,
|
||||
TR_KEY_message_level,
|
||||
TR_KEY_metadataPercentComplete,
|
||||
TR_KEY_metadata_percent_complete_camel,
|
||||
TR_KEY_metadata_percent_complete,
|
||||
TR_KEY_metadata_size,
|
||||
TR_KEY_metainfo,
|
||||
TR_KEY_method,
|
||||
@@ -215,17 +332,35 @@ enum // NOLINT(performance-enum-size)
|
||||
TR_KEY_msg_type,
|
||||
TR_KEY_mtimes,
|
||||
TR_KEY_name,
|
||||
TR_KEY_nextAnnounceTime,
|
||||
TR_KEY_nextScrapeTime,
|
||||
TR_KEY_next_announce_time_camel,
|
||||
TR_KEY_next_scrape_time_camel,
|
||||
TR_KEY_next_announce_time,
|
||||
TR_KEY_next_scrape_time,
|
||||
TR_KEY_nodes,
|
||||
TR_KEY_nodes6,
|
||||
TR_KEY_open_dialog_dir_kebab,
|
||||
TR_KEY_open_dialog_dir,
|
||||
TR_KEY_p,
|
||||
TR_KEY_params,
|
||||
TR_KEY_path,
|
||||
TR_KEY_paused,
|
||||
TR_KEY_pausedTorrentCount,
|
||||
TR_KEY_paused_torrent_count_camel,
|
||||
TR_KEY_paused_torrent_count,
|
||||
TR_KEY_peer_congestion_algorithm_kebab,
|
||||
TR_KEY_peer_limit_kebab,
|
||||
TR_KEY_peer_limit_global_kebab,
|
||||
TR_KEY_peer_limit_per_torrent_kebab,
|
||||
TR_KEY_peer_port_kebab,
|
||||
TR_KEY_peer_port_random_high_kebab,
|
||||
TR_KEY_peer_port_random_low_kebab,
|
||||
TR_KEY_peer_port_random_on_start_kebab,
|
||||
TR_KEY_peer_socket_tos_kebab,
|
||||
TR_KEY_peer_is_choked_camel,
|
||||
TR_KEY_peer_is_interested_camel,
|
||||
TR_KEY_peer_congestion_algorithm,
|
||||
TR_KEY_peer_id,
|
||||
TR_KEY_peer_is_choked,
|
||||
TR_KEY_peer_is_interested,
|
||||
TR_KEY_peer_limit,
|
||||
TR_KEY_peer_limit_global,
|
||||
TR_KEY_peer_limit_per_torrent,
|
||||
@@ -234,64 +369,113 @@ enum // NOLINT(performance-enum-size)
|
||||
TR_KEY_peer_port_random_low,
|
||||
TR_KEY_peer_port_random_on_start,
|
||||
TR_KEY_peer_socket_tos,
|
||||
TR_KEY_peerIsChoked,
|
||||
TR_KEY_peerIsInterested,
|
||||
TR_KEY_peer_id,
|
||||
TR_KEY_peers,
|
||||
TR_KEY_peers2,
|
||||
TR_KEY_peers2_6_kebab,
|
||||
TR_KEY_peers2_6,
|
||||
TR_KEY_peersConnected,
|
||||
TR_KEY_peersFrom,
|
||||
TR_KEY_peersGettingFromUs,
|
||||
TR_KEY_peersSendingToUs,
|
||||
TR_KEY_percentComplete,
|
||||
TR_KEY_percentDone,
|
||||
TR_KEY_peers_connected_camel,
|
||||
TR_KEY_peers_from_camel,
|
||||
TR_KEY_peers_getting_from_us_camel,
|
||||
TR_KEY_peers_sending_to_us_camel,
|
||||
TR_KEY_peers_connected,
|
||||
TR_KEY_peers_from,
|
||||
TR_KEY_peers_getting_from_us,
|
||||
TR_KEY_peers_sending_to_us,
|
||||
TR_KEY_percent_complete_camel,
|
||||
TR_KEY_percent_done_camel,
|
||||
TR_KEY_percent_complete,
|
||||
TR_KEY_percent_done,
|
||||
TR_KEY_pex_enabled_kebab,
|
||||
TR_KEY_pex_enabled,
|
||||
TR_KEY_pidfile,
|
||||
TR_KEY_piece,
|
||||
TR_KEY_piece_length,
|
||||
TR_KEY_pieceCount,
|
||||
TR_KEY_pieceSize,
|
||||
TR_KEY_piece_count_camel,
|
||||
TR_KEY_piece_size_camel,
|
||||
TR_KEY_piece_count,
|
||||
TR_KEY_piece_size,
|
||||
TR_KEY_pieces,
|
||||
TR_KEY_port,
|
||||
TR_KEY_port_forwarding_enabled_kebab,
|
||||
TR_KEY_port_is_open_kebab,
|
||||
TR_KEY_port_forwarding_enabled,
|
||||
TR_KEY_port_is_open,
|
||||
TR_KEY_preallocation,
|
||||
TR_KEY_preferred_transports,
|
||||
TR_KEY_primary_mime_type_kebab,
|
||||
TR_KEY_primary_mime_type,
|
||||
TR_KEY_priorities,
|
||||
TR_KEY_priority,
|
||||
TR_KEY_priority_high_kebab,
|
||||
TR_KEY_priority_low_kebab,
|
||||
TR_KEY_priority_normal_kebab,
|
||||
TR_KEY_priority_high,
|
||||
TR_KEY_priority_low,
|
||||
TR_KEY_priority_normal,
|
||||
TR_KEY_private,
|
||||
TR_KEY_progress,
|
||||
TR_KEY_prompt_before_exit_kebab,
|
||||
TR_KEY_prompt_before_exit,
|
||||
TR_KEY_proxy_url,
|
||||
TR_KEY_queue_stalled_enabled_kebab,
|
||||
TR_KEY_queue_stalled_minutes_kebab,
|
||||
TR_KEY_queue_position_camel,
|
||||
TR_KEY_queue_position,
|
||||
TR_KEY_queue_stalled_enabled,
|
||||
TR_KEY_queue_stalled_minutes,
|
||||
TR_KEY_queuePosition,
|
||||
TR_KEY_rateDownload,
|
||||
TR_KEY_rateToClient,
|
||||
TR_KEY_rateToPeer,
|
||||
TR_KEY_rateUpload,
|
||||
TR_KEY_rate_download_camel,
|
||||
TR_KEY_rate_to_client_camel,
|
||||
TR_KEY_rate_to_peer_camel,
|
||||
TR_KEY_rate_upload_camel,
|
||||
TR_KEY_rate_download,
|
||||
TR_KEY_rate_to_client,
|
||||
TR_KEY_rate_to_peer,
|
||||
TR_KEY_rate_upload,
|
||||
TR_KEY_ratio_limit_kebab,
|
||||
TR_KEY_ratio_limit_enabled_kebab,
|
||||
TR_KEY_ratio_mode_kebab,
|
||||
TR_KEY_ratio_limit,
|
||||
TR_KEY_ratio_limit_enabled,
|
||||
TR_KEY_ratio_mode,
|
||||
TR_KEY_read_clipboard_kebab,
|
||||
TR_KEY_read_clipboard,
|
||||
TR_KEY_recheckProgress,
|
||||
TR_KEY_recheck_progress_camel,
|
||||
TR_KEY_recheck_progress,
|
||||
TR_KEY_remote_session_enabled_kebab,
|
||||
TR_KEY_remote_session_host_kebab,
|
||||
TR_KEY_remote_session_https_kebab,
|
||||
TR_KEY_remote_session_password_kebab,
|
||||
TR_KEY_remote_session_port_kebab,
|
||||
TR_KEY_remote_session_requres_authentication_kebab,
|
||||
TR_KEY_remote_session_username_kebab,
|
||||
TR_KEY_remote_session_enabled,
|
||||
TR_KEY_remote_session_host,
|
||||
TR_KEY_remote_session_https,
|
||||
TR_KEY_remote_session_password,
|
||||
TR_KEY_remote_session_port,
|
||||
TR_KEY_remote_session_requres_authentication,
|
||||
TR_KEY_remote_session_username,
|
||||
TR_KEY_remote_session_requires_authentication,
|
||||
TR_KEY_remote_session_rpc_url_path,
|
||||
TR_KEY_remote_session_username,
|
||||
TR_KEY_removed,
|
||||
TR_KEY_rename_partial_files_kebab,
|
||||
TR_KEY_rename_partial_files,
|
||||
TR_KEY_reqq,
|
||||
TR_KEY_result,
|
||||
TR_KEY_rpc_authentication_required_kebab,
|
||||
TR_KEY_rpc_bind_address_kebab,
|
||||
TR_KEY_rpc_enabled_kebab,
|
||||
TR_KEY_rpc_host_whitelist_kebab,
|
||||
TR_KEY_rpc_host_whitelist_enabled_kebab,
|
||||
TR_KEY_rpc_password_kebab,
|
||||
TR_KEY_rpc_port_kebab,
|
||||
TR_KEY_rpc_socket_mode_kebab,
|
||||
TR_KEY_rpc_url_kebab,
|
||||
TR_KEY_rpc_username_kebab,
|
||||
TR_KEY_rpc_version_kebab,
|
||||
TR_KEY_rpc_version_minimum_kebab,
|
||||
TR_KEY_rpc_version_semver_kebab,
|
||||
TR_KEY_rpc_whitelist_kebab,
|
||||
TR_KEY_rpc_whitelist_enabled_kebab,
|
||||
TR_KEY_rpc_authentication_required,
|
||||
TR_KEY_rpc_bind_address,
|
||||
TR_KEY_rpc_enabled,
|
||||
@@ -308,32 +492,62 @@ enum // NOLINT(performance-enum-size)
|
||||
TR_KEY_rpc_whitelist,
|
||||
TR_KEY_rpc_whitelist_enabled,
|
||||
TR_KEY_scrape,
|
||||
TR_KEY_scrape_paused_torrents_enabled_kebab,
|
||||
TR_KEY_scrape_state_camel,
|
||||
TR_KEY_scrape_paused_torrents_enabled,
|
||||
TR_KEY_scrapeState,
|
||||
TR_KEY_scrape_state,
|
||||
TR_KEY_script_torrent_added_enabled_kebab,
|
||||
TR_KEY_script_torrent_added_filename_kebab,
|
||||
TR_KEY_script_torrent_done_enabled_kebab,
|
||||
TR_KEY_script_torrent_done_filename_kebab,
|
||||
TR_KEY_script_torrent_done_seeding_enabled_kebab,
|
||||
TR_KEY_script_torrent_done_seeding_filename_kebab,
|
||||
TR_KEY_script_torrent_added_enabled,
|
||||
TR_KEY_script_torrent_added_filename,
|
||||
TR_KEY_script_torrent_done_enabled,
|
||||
TR_KEY_script_torrent_done_filename,
|
||||
TR_KEY_script_torrent_done_seeding_enabled,
|
||||
TR_KEY_script_torrent_done_seeding_filename,
|
||||
TR_KEY_seconds_active_kebab,
|
||||
TR_KEY_seconds_active_camel,
|
||||
TR_KEY_seconds_downloading_camel,
|
||||
TR_KEY_seconds_seeding_camel,
|
||||
TR_KEY_seconds_active,
|
||||
TR_KEY_secondsActive,
|
||||
TR_KEY_secondsDownloading,
|
||||
TR_KEY_secondsSeeding,
|
||||
TR_KEY_seconds_downloading,
|
||||
TR_KEY_seconds_seeding,
|
||||
TR_KEY_seed_queue_enabled_kebab,
|
||||
TR_KEY_seed_queue_size_kebab,
|
||||
TR_KEY_seed_idle_limit_camel,
|
||||
TR_KEY_seed_idle_mode_camel,
|
||||
TR_KEY_seed_ratio_limit_camel,
|
||||
TR_KEY_seed_ratio_limited_camel,
|
||||
TR_KEY_seed_ratio_mode_camel,
|
||||
TR_KEY_seed_idle_limit,
|
||||
TR_KEY_seed_idle_mode,
|
||||
TR_KEY_seed_queue_enabled,
|
||||
TR_KEY_seed_queue_size,
|
||||
TR_KEY_seedIdleLimit,
|
||||
TR_KEY_seedIdleMode,
|
||||
TR_KEY_seedRatioLimit,
|
||||
TR_KEY_seedRatioLimited,
|
||||
TR_KEY_seedRatioMode,
|
||||
TR_KEY_seederCount,
|
||||
TR_KEY_seed_ratio_limit,
|
||||
TR_KEY_seed_ratio_limited,
|
||||
TR_KEY_seed_ratio_mode,
|
||||
TR_KEY_seeder_count_camel,
|
||||
TR_KEY_seeder_count,
|
||||
TR_KEY_seeding_time_seconds_kebab,
|
||||
TR_KEY_seeding_time_seconds,
|
||||
TR_KEY_sequential_download,
|
||||
TR_KEY_sequential_download_from_piece,
|
||||
TR_KEY_session_count_kebab,
|
||||
TR_KEY_session_id_kebab,
|
||||
TR_KEY_session_count_camel,
|
||||
TR_KEY_session_count,
|
||||
TR_KEY_session_id,
|
||||
TR_KEY_sessionCount,
|
||||
TR_KEY_show_backup_trackers_kebab,
|
||||
TR_KEY_show_extra_peer_details_kebab,
|
||||
TR_KEY_show_filterbar_kebab,
|
||||
TR_KEY_show_notification_area_icon_kebab,
|
||||
TR_KEY_show_options_window_kebab,
|
||||
TR_KEY_show_statusbar_kebab,
|
||||
TR_KEY_show_toolbar_kebab,
|
||||
TR_KEY_show_tracker_scrapes_kebab,
|
||||
TR_KEY_show_backup_trackers,
|
||||
TR_KEY_show_extra_peer_details,
|
||||
TR_KEY_show_filterbar,
|
||||
@@ -343,15 +557,27 @@ enum // NOLINT(performance-enum-size)
|
||||
TR_KEY_show_toolbar,
|
||||
TR_KEY_show_tracker_scrapes,
|
||||
TR_KEY_sitename,
|
||||
TR_KEY_size_bytes_kebab,
|
||||
TR_KEY_size_units_kebab,
|
||||
TR_KEY_size_when_done_camel,
|
||||
TR_KEY_size_bytes,
|
||||
TR_KEY_size_units,
|
||||
TR_KEY_sizeWhenDone,
|
||||
TR_KEY_size_when_done,
|
||||
TR_KEY_sleep_per_seconds_during_verify,
|
||||
TR_KEY_socket_address,
|
||||
TR_KEY_sort_mode_kebab,
|
||||
TR_KEY_sort_reversed_kebab,
|
||||
TR_KEY_sort_mode,
|
||||
TR_KEY_sort_reversed,
|
||||
TR_KEY_source,
|
||||
TR_KEY_speed,
|
||||
TR_KEY_speed_Bps_kebab,
|
||||
TR_KEY_speed_bytes_kebab,
|
||||
TR_KEY_speed_limit_down_kebab,
|
||||
TR_KEY_speed_limit_down_enabled_kebab,
|
||||
TR_KEY_speed_limit_up_kebab,
|
||||
TR_KEY_speed_limit_up_enabled_kebab,
|
||||
TR_KEY_speed_units_kebab,
|
||||
TR_KEY_speed_Bps,
|
||||
TR_KEY_speed_bytes,
|
||||
TR_KEY_speed_limit_down,
|
||||
@@ -359,70 +585,109 @@ enum // NOLINT(performance-enum-size)
|
||||
TR_KEY_speed_limit_up,
|
||||
TR_KEY_speed_limit_up_enabled,
|
||||
TR_KEY_speed_units,
|
||||
TR_KEY_start_added_torrents_kebab,
|
||||
TR_KEY_start_minimized_kebab,
|
||||
TR_KEY_start_date_camel,
|
||||
TR_KEY_start_added_torrents,
|
||||
TR_KEY_start_date,
|
||||
TR_KEY_start_minimized,
|
||||
TR_KEY_startDate,
|
||||
TR_KEY_start_paused,
|
||||
TR_KEY_status,
|
||||
TR_KEY_statusbar_stats_kebab,
|
||||
TR_KEY_statusbar_stats,
|
||||
TR_KEY_tag,
|
||||
TR_KEY_tcp_enabled_kebab,
|
||||
TR_KEY_tcp_enabled,
|
||||
TR_KEY_tier,
|
||||
TR_KEY_time_checked,
|
||||
TR_KEY_torrent_added,
|
||||
TR_KEY_torrent_added_kebab,
|
||||
TR_KEY_torrent_added_notification_command,
|
||||
TR_KEY_torrent_added_notification_enabled_kebab,
|
||||
TR_KEY_torrent_added_verify_mode_kebab,
|
||||
TR_KEY_torrent_complete_notification_command,
|
||||
TR_KEY_torrent_complete_notification_enabled_kebab,
|
||||
TR_KEY_torrent_complete_sound_command_kebab,
|
||||
TR_KEY_torrent_complete_sound_enabled_kebab,
|
||||
TR_KEY_torrent_duplicate_kebab,
|
||||
TR_KEY_torrent_get_kebab,
|
||||
TR_KEY_torrent_set_kebab,
|
||||
TR_KEY_torrent_set_location_kebab,
|
||||
TR_KEY_torrent_count_camel,
|
||||
TR_KEY_torrent_file_camel,
|
||||
TR_KEY_torrent_added,
|
||||
TR_KEY_torrent_added_notification_enabled,
|
||||
TR_KEY_torrent_added_verify_mode,
|
||||
TR_KEY_torrent_complete_notification_command,
|
||||
TR_KEY_torrent_complete_notification_enabled,
|
||||
TR_KEY_torrent_complete_sound_command,
|
||||
TR_KEY_torrent_complete_sound_enabled,
|
||||
TR_KEY_torrent_complete_verify_enabled,
|
||||
TR_KEY_torrent_count,
|
||||
TR_KEY_torrent_duplicate,
|
||||
TR_KEY_torrent_file,
|
||||
TR_KEY_torrent_get,
|
||||
TR_KEY_torrent_set,
|
||||
TR_KEY_torrent_set_location,
|
||||
TR_KEY_torrentCount,
|
||||
TR_KEY_torrentFile,
|
||||
TR_KEY_torrent_complete_verify_enabled,
|
||||
TR_KEY_torrents,
|
||||
TR_KEY_totalSize,
|
||||
TR_KEY_total_size_camel,
|
||||
TR_KEY_total_size,
|
||||
TR_KEY_trackerAdd,
|
||||
TR_KEY_trackerList,
|
||||
TR_KEY_trackerRemove,
|
||||
TR_KEY_trackerReplace,
|
||||
TR_KEY_trackerStats,
|
||||
TR_KEY_tracker_add_camel,
|
||||
TR_KEY_tracker_list_camel,
|
||||
TR_KEY_tracker_remove_camel,
|
||||
TR_KEY_tracker_replace_camel,
|
||||
TR_KEY_tracker_stats_camel,
|
||||
TR_KEY_tracker_add,
|
||||
TR_KEY_tracker_list,
|
||||
TR_KEY_tracker_remove,
|
||||
TR_KEY_tracker_replace,
|
||||
TR_KEY_tracker_stats,
|
||||
TR_KEY_trackers,
|
||||
TR_KEY_trash_can_enabled_kebab,
|
||||
TR_KEY_trash_original_torrent_files_kebab,
|
||||
TR_KEY_trash_can_enabled,
|
||||
TR_KEY_trash_original_torrent_files,
|
||||
TR_KEY_umask,
|
||||
TR_KEY_units,
|
||||
TR_KEY_upload_slots_per_torrent,
|
||||
TR_KEY_uploadLimit,
|
||||
TR_KEY_uploadLimited,
|
||||
TR_KEY_uploadRatio,
|
||||
TR_KEY_uploadSpeed,
|
||||
TR_KEY_upload_slots_per_torrent_kebab,
|
||||
TR_KEY_upload_limit_camel,
|
||||
TR_KEY_upload_limited_camel,
|
||||
TR_KEY_upload_ratio_camel,
|
||||
TR_KEY_upload_speed_camel,
|
||||
TR_KEY_upload_limit,
|
||||
TR_KEY_upload_limited,
|
||||
TR_KEY_upload_only,
|
||||
TR_KEY_upload_ratio,
|
||||
TR_KEY_upload_slots_per_torrent,
|
||||
TR_KEY_upload_speed,
|
||||
TR_KEY_uploaded,
|
||||
TR_KEY_uploaded_bytes_kebab,
|
||||
TR_KEY_uploaded_bytes_camel,
|
||||
TR_KEY_uploaded_ever_camel,
|
||||
TR_KEY_uploaded_bytes,
|
||||
TR_KEY_uploadedBytes,
|
||||
TR_KEY_uploadedEver,
|
||||
TR_KEY_uploaded_ever,
|
||||
TR_KEY_url_list,
|
||||
TR_KEY_use_global_speed_limit_kebab,
|
||||
TR_KEY_use_speed_limit_kebab,
|
||||
TR_KEY_use_global_speed_limit,
|
||||
TR_KEY_use_speed_limit,
|
||||
TR_KEY_user_has_given_informed_consent_kebab,
|
||||
TR_KEY_user_has_given_informed_consent,
|
||||
TR_KEY_ut_holepunch,
|
||||
TR_KEY_ut_metadata,
|
||||
TR_KEY_ut_pex,
|
||||
TR_KEY_utp_enabled_kebab,
|
||||
TR_KEY_utp_enabled,
|
||||
TR_KEY_v,
|
||||
TR_KEY_version,
|
||||
TR_KEY_wanted,
|
||||
TR_KEY_watch_dir_kebab,
|
||||
TR_KEY_watch_dir_enabled_kebab,
|
||||
TR_KEY_watch_dir_force_generic_kebab,
|
||||
TR_KEY_watch_dir,
|
||||
TR_KEY_watch_dir_enabled,
|
||||
TR_KEY_watch_dir_force_generic,
|
||||
TR_KEY_webseeds,
|
||||
TR_KEY_webseedsSendingToUs,
|
||||
TR_KEY_webseeds_sending_to_us_camel,
|
||||
TR_KEY_webseeds_sending_to_us,
|
||||
TR_KEY_yourip,
|
||||
TR_N_KEYS
|
||||
};
|
||||
@@ -447,3 +712,10 @@ enum // NOLINT(performance-enum-size)
|
||||
* created.
|
||||
*/
|
||||
[[nodiscard]] tr_quark tr_quark_new(std::string_view str);
|
||||
|
||||
/**
|
||||
* Get the replacement quark from old deprecated quarks.
|
||||
*
|
||||
* Note: Temporary shim just for the transition period to snake_case.
|
||||
*/
|
||||
[[nodiscard]] tr_quark tr_quark_convert(tr_quark quark);
|
||||
|
||||
@@ -74,7 +74,7 @@ auto load_peers(tr_variant::Map const& map, tr_torrent* tor)
|
||||
ret = tr_resume::Peers;
|
||||
}
|
||||
|
||||
if (auto const* l = map.find_if<tr_variant::Vector>(TR_KEY_peers2_6); l != nullptr)
|
||||
if (auto const* l = map.find_if<tr_variant::Vector>({ TR_KEY_peers2_6, TR_KEY_peers2_6_kebab }); l != nullptr)
|
||||
{
|
||||
auto const num_added = add_peers(tor, *l);
|
||||
tr_logAddTraceTor(tor, fmt::format("Loaded {} IPv6 peers from resume file", num_added));
|
||||
@@ -266,7 +266,7 @@ void save_idle_limits(tr_variant::Map& map, tr_torrent const* tor)
|
||||
|
||||
void load_single_speed_limit(tr_variant::Map const& map, tr_direction dir, tr_torrent* tor)
|
||||
{
|
||||
if (auto const i = map.value_if<int64_t>(TR_KEY_speed_Bps); i)
|
||||
if (auto const i = map.value_if<int64_t>({ TR_KEY_speed_Bps, TR_KEY_speed_Bps_kebab }); i)
|
||||
{
|
||||
tor->set_speed_limit(dir, Speed{ *i, Speed::Units::Byps });
|
||||
}
|
||||
@@ -275,12 +275,12 @@ void load_single_speed_limit(tr_variant::Map const& map, tr_direction dir, tr_to
|
||||
tor->set_speed_limit(dir, Speed{ *i2, Speed::Units::KByps });
|
||||
}
|
||||
|
||||
if (auto const b = map.value_if<bool>(TR_KEY_use_speed_limit); b)
|
||||
if (auto const b = map.value_if<bool>({ TR_KEY_use_speed_limit, TR_KEY_use_speed_limit_kebab }); b)
|
||||
{
|
||||
tor->use_speed_limit(dir, *b);
|
||||
}
|
||||
|
||||
if (auto const b = map.value_if<bool>(TR_KEY_use_global_speed_limit); b)
|
||||
if (auto const b = map.value_if<bool>({ TR_KEY_use_global_speed_limit, TR_KEY_use_global_speed_limit_kebab }); b)
|
||||
{
|
||||
tr_torrentUseSessionLimits(tor, *b);
|
||||
}
|
||||
@@ -290,13 +290,15 @@ auto load_speed_limits(tr_variant::Map const& map, tr_torrent* tor)
|
||||
{
|
||||
auto ret = tr_resume::fields_t{};
|
||||
|
||||
if (auto const* child = map.find_if<tr_variant::Map>(TR_KEY_speed_limit_up); child != nullptr)
|
||||
if (auto const* child = map.find_if<tr_variant::Map>({ TR_KEY_speed_limit_up, TR_KEY_speed_limit_up_kebab });
|
||||
child != nullptr)
|
||||
{
|
||||
load_single_speed_limit(*child, TR_UP, tor);
|
||||
ret = tr_resume::Speedlimit;
|
||||
}
|
||||
|
||||
if (auto const* child = map.find_if<tr_variant::Map>(TR_KEY_speed_limit_down); child != nullptr)
|
||||
if (auto const* child = map.find_if<tr_variant::Map>({ TR_KEY_speed_limit_down, TR_KEY_speed_limit_down_kebab });
|
||||
child != nullptr)
|
||||
{
|
||||
load_single_speed_limit(*child, TR_DOWN, tor);
|
||||
ret = tr_resume::Speedlimit;
|
||||
@@ -307,18 +309,18 @@ auto load_speed_limits(tr_variant::Map const& map, tr_torrent* tor)
|
||||
|
||||
tr_resume::fields_t load_ratio_limits(tr_variant::Map const& map, tr_torrent* tor)
|
||||
{
|
||||
auto const* const d = map.find_if<tr_variant::Map>(TR_KEY_ratio_limit);
|
||||
auto const* const d = map.find_if<tr_variant::Map>({ TR_KEY_ratio_limit, TR_KEY_ratio_limit_kebab });
|
||||
if (d == nullptr)
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
if (auto const dratio = d->value_if<double>(TR_KEY_ratio_limit); dratio)
|
||||
if (auto const dratio = d->value_if<double>({ TR_KEY_ratio_limit, TR_KEY_ratio_limit_kebab }); dratio)
|
||||
{
|
||||
tor->set_seed_ratio(*dratio);
|
||||
}
|
||||
|
||||
if (auto const i = d->value_if<int64_t>(TR_KEY_ratio_mode); i)
|
||||
if (auto const i = d->value_if<int64_t>({ TR_KEY_ratio_mode, TR_KEY_ratio_mode_kebab }); i)
|
||||
{
|
||||
tor->set_seed_ratio_mode(static_cast<tr_ratiolimit>(*i));
|
||||
}
|
||||
@@ -328,18 +330,18 @@ tr_resume::fields_t load_ratio_limits(tr_variant::Map const& map, tr_torrent* to
|
||||
|
||||
tr_resume::fields_t load_idle_limits(tr_variant::Map const& map, tr_torrent* tor)
|
||||
{
|
||||
auto const* const d = map.find_if<tr_variant::Map>(TR_KEY_idle_limit);
|
||||
auto const* const d = map.find_if<tr_variant::Map>({ TR_KEY_idle_limit, TR_KEY_idle_limit_kebab });
|
||||
if (d == nullptr)
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
if (auto const imin = d->value_if<int64_t>(TR_KEY_idle_limit); imin)
|
||||
if (auto const imin = d->value_if<int64_t>({ TR_KEY_idle_limit, TR_KEY_idle_limit_kebab }); imin)
|
||||
{
|
||||
tor->set_idle_limit_minutes(*imin);
|
||||
}
|
||||
|
||||
if (auto const i = d->value_if<int64_t>(TR_KEY_idle_mode); i)
|
||||
if (auto const i = d->value_if<int64_t>({ TR_KEY_idle_mode, TR_KEY_idle_mode_kebab }); i)
|
||||
{
|
||||
tor->set_idle_limit_mode(static_cast<tr_idlelimit>(*i));
|
||||
}
|
||||
@@ -665,7 +667,8 @@ tr_resume::fields_t load_from_file(tr_torrent* tor, tr_torrent::ResumeHelper& he
|
||||
|
||||
if ((fields_to_load & (tr_resume::Progress | tr_resume::IncompleteDir)) != 0)
|
||||
{
|
||||
if (auto sv = map.value_if<std::string_view>(TR_KEY_incomplete_dir); sv && !std::empty(*sv))
|
||||
if (auto sv = map.value_if<std::string_view>({ TR_KEY_incomplete_dir, TR_KEY_incomplete_dir_kebab });
|
||||
sv && !std::empty(*sv))
|
||||
{
|
||||
helper.load_incomplete_dir(*sv);
|
||||
fields_loaded |= tr_resume::IncompleteDir;
|
||||
@@ -692,7 +695,7 @@ tr_resume::fields_t load_from_file(tr_torrent* tor, tr_torrent::ResumeHelper& he
|
||||
|
||||
if ((fields_to_load & tr_resume::MaxPeers) != 0)
|
||||
{
|
||||
if (auto i = map.value_if<int64_t>(TR_KEY_max_peers); i)
|
||||
if (auto i = map.value_if<int64_t>({ TR_KEY_max_peers, TR_KEY_max_peers_kebab }); i)
|
||||
{
|
||||
tor->set_peer_limit(static_cast<uint16_t>(*i));
|
||||
fields_loaded |= tr_resume::MaxPeers;
|
||||
@@ -710,7 +713,7 @@ tr_resume::fields_t load_from_file(tr_torrent* tor, tr_torrent::ResumeHelper& he
|
||||
|
||||
if ((fields_to_load & tr_resume::AddedDate) != 0)
|
||||
{
|
||||
if (auto i = map.value_if<int64_t>(TR_KEY_added_date); i)
|
||||
if (auto i = map.value_if<int64_t>({ TR_KEY_added_date, TR_KEY_added_date_kebab }); i)
|
||||
{
|
||||
helper.load_date_added(static_cast<time_t>(*i));
|
||||
fields_loaded |= tr_resume::AddedDate;
|
||||
@@ -719,7 +722,7 @@ tr_resume::fields_t load_from_file(tr_torrent* tor, tr_torrent::ResumeHelper& he
|
||||
|
||||
if ((fields_to_load & tr_resume::DoneDate) != 0)
|
||||
{
|
||||
if (auto i = map.value_if<int64_t>(TR_KEY_done_date); i)
|
||||
if (auto i = map.value_if<int64_t>({ TR_KEY_done_date, TR_KEY_done_date_kebab }); i)
|
||||
{
|
||||
helper.load_date_done(static_cast<time_t>(*i));
|
||||
fields_loaded |= tr_resume::DoneDate;
|
||||
@@ -728,7 +731,7 @@ tr_resume::fields_t load_from_file(tr_torrent* tor, tr_torrent::ResumeHelper& he
|
||||
|
||||
if ((fields_to_load & tr_resume::ActivityDate) != 0)
|
||||
{
|
||||
if (auto i = map.value_if<int64_t>(TR_KEY_activity_date); i)
|
||||
if (auto i = map.value_if<int64_t>({ TR_KEY_activity_date, TR_KEY_activity_date_kebab }); i)
|
||||
{
|
||||
tor->set_date_active(*i);
|
||||
fields_loaded |= tr_resume::ActivityDate;
|
||||
@@ -737,7 +740,7 @@ tr_resume::fields_t load_from_file(tr_torrent* tor, tr_torrent::ResumeHelper& he
|
||||
|
||||
if ((fields_to_load & tr_resume::TimeSeeding) != 0)
|
||||
{
|
||||
if (auto i = map.value_if<int64_t>(TR_KEY_seeding_time_seconds); i)
|
||||
if (auto i = map.value_if<int64_t>({ TR_KEY_seeding_time_seconds, TR_KEY_seeding_time_seconds_kebab }); i)
|
||||
{
|
||||
helper.load_seconds_seeding_before_current_start(*i);
|
||||
fields_loaded |= tr_resume::TimeSeeding;
|
||||
@@ -746,7 +749,7 @@ tr_resume::fields_t load_from_file(tr_torrent* tor, tr_torrent::ResumeHelper& he
|
||||
|
||||
if ((fields_to_load & tr_resume::TimeDownloading) != 0)
|
||||
{
|
||||
if (auto i = map.value_if<int64_t>(TR_KEY_downloading_time_seconds); i)
|
||||
if (auto i = map.value_if<int64_t>({ TR_KEY_downloading_time_seconds, TR_KEY_downloading_time_seconds_kebab }); i)
|
||||
{
|
||||
helper.load_seconds_downloading_before_current_start(*i);
|
||||
fields_loaded |= tr_resume::TimeDownloading;
|
||||
@@ -755,7 +758,8 @@ tr_resume::fields_t load_from_file(tr_torrent* tor, tr_torrent::ResumeHelper& he
|
||||
|
||||
if ((fields_to_load & tr_resume::BandwidthPriority) != 0)
|
||||
{
|
||||
if (auto i = map.value_if<int64_t>(TR_KEY_bandwidth_priority); i && tr_isPriority(static_cast<tr_priority_t>(*i)))
|
||||
if (auto i = map.value_if<int64_t>({ TR_KEY_bandwidth_priority, TR_KEY_bandwidth_priority_kebab });
|
||||
i && tr_isPriority(static_cast<tr_priority_t>(*i)))
|
||||
{
|
||||
tr_torrentSetPriority(tor, static_cast<tr_priority_t>(*i));
|
||||
fields_loaded |= tr_resume::BandwidthPriority;
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
struct evbuffer;
|
||||
|
||||
/* session-id is used to make cross-site request forgery attacks difficult.
|
||||
/* session_id is used to make cross-site request forgery attacks difficult.
|
||||
* Don't disable this feature unless you really know what you're doing!
|
||||
* https://en.wikipedia.org/wiki/Cross-site_request_forgery
|
||||
* https://shiflett.org/articles/cross-site-request-forgeries
|
||||
@@ -599,7 +599,7 @@ void handle_request(struct evhttp_request* req, void* arg)
|
||||
"<li>Enable password authentication, then any hostname is allowed.</li>"
|
||||
"<li>Add the hostname you want to use to the whitelist in settings.</li>"
|
||||
"</ul></p>"
|
||||
"<p>If you're editing settings.json, see the 'rpc-host-whitelist' and 'rpc-host-whitelist-enabled' entries.</p>"
|
||||
"<p>If you're editing settings.json, see the 'rpc_host_whitelist' and 'rpc_host_whitelist_enabled' entries.</p>"
|
||||
"<p>This requirement has been added to help prevent "
|
||||
"<a href=\"https://en.wikipedia.org/wiki/DNS_rebinding\">DNS Rebinding</a> "
|
||||
"attacks.</p>";
|
||||
@@ -612,9 +612,10 @@ void handle_request(struct evhttp_request* req, void* arg)
|
||||
{
|
||||
auto const session_id = std::string{ server->session->sessionId() };
|
||||
auto const body = fmt::format(
|
||||
"<p>Your request had an invalid session-id header.</p>"
|
||||
"<p>Your request had an invalid session_id header.</p>"
|
||||
"<p>To fix this, follow these steps:"
|
||||
"<ol><li> When reading a response, get its X-Transmission-Session-Id header and remember it"
|
||||
"<ol><li> When reading a response, get its " TR_RPC_SESSION_ID_HEADER
|
||||
" header and remember it"
|
||||
"<li> Add the updated header to your outgoing requests"
|
||||
"<li> When you get this 409 error message, resend your request with the updated header"
|
||||
"</ol></p>"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -101,29 +101,30 @@ void bandwidthGroupRead(tr_session* session, std::string_view config_dir)
|
||||
auto& group = session->getBandwidthGroup(tr_interned_string{ key });
|
||||
auto limits = tr_bandwidth_limits{};
|
||||
|
||||
if (auto const val = group_map->value_if<bool>(TR_KEY_uploadLimited))
|
||||
if (auto const val = group_map->value_if<bool>({ TR_KEY_upload_limited, TR_KEY_upload_limited_camel }); val)
|
||||
{
|
||||
limits.up_limited = *val;
|
||||
}
|
||||
|
||||
if (auto const val = group_map->value_if<bool>(TR_KEY_downloadLimited))
|
||||
if (auto const val = group_map->value_if<bool>({ TR_KEY_download_limited, TR_KEY_download_limited_camel }); val)
|
||||
{
|
||||
limits.down_limited = *val;
|
||||
}
|
||||
|
||||
if (auto const val = group_map->value_if<int64_t>(TR_KEY_uploadLimit))
|
||||
if (auto const val = group_map->value_if<int64_t>({ TR_KEY_upload_limit, TR_KEY_upload_limit_camel }); val)
|
||||
{
|
||||
limits.up_limit = Speed{ *val, Speed::Units::KByps };
|
||||
}
|
||||
|
||||
if (auto const val = group_map->value_if<int64_t>(TR_KEY_downloadLimit))
|
||||
if (auto const val = group_map->value_if<int64_t>({ TR_KEY_download_limit, TR_KEY_download_limit_camel }); val)
|
||||
{
|
||||
limits.down_limit = Speed{ *val, Speed::Units::KByps };
|
||||
}
|
||||
|
||||
group.set_limits(limits);
|
||||
|
||||
if (auto const val = group_map->value_if<bool>(TR_KEY_honorsSessionLimits))
|
||||
if (auto const val = group_map->value_if<bool>({ TR_KEY_honors_session_limits, TR_KEY_honors_session_limits_camel });
|
||||
val)
|
||||
{
|
||||
group.honor_parent_limits(TR_UP, *val);
|
||||
group.honor_parent_limits(TR_DOWN, *val);
|
||||
@@ -139,12 +140,12 @@ void bandwidthGroupWrite(tr_session const* session, std::string_view config_dir)
|
||||
{
|
||||
auto const limits = group->get_limits();
|
||||
auto group_map = tr_variant::Map{ 6U };
|
||||
group_map.try_emplace(TR_KEY_downloadLimit, limits.down_limit.count(Speed::Units::KByps));
|
||||
group_map.try_emplace(TR_KEY_downloadLimited, limits.down_limited);
|
||||
group_map.try_emplace(TR_KEY_honorsSessionLimits, group->are_parent_limits_honored(TR_UP));
|
||||
group_map.try_emplace(TR_KEY_download_limit, limits.down_limit.count(Speed::Units::KByps));
|
||||
group_map.try_emplace(TR_KEY_download_limited, limits.down_limited);
|
||||
group_map.try_emplace(TR_KEY_honors_session_limits, group->are_parent_limits_honored(TR_UP));
|
||||
group_map.try_emplace(TR_KEY_name, name.sv());
|
||||
group_map.try_emplace(TR_KEY_uploadLimit, limits.up_limit.count(Speed::Units::KByps));
|
||||
group_map.try_emplace(TR_KEY_uploadLimited, limits.up_limited);
|
||||
group_map.try_emplace(TR_KEY_upload_limit, limits.up_limit.count(Speed::Units::KByps));
|
||||
group_map.try_emplace(TR_KEY_upload_limited, limits.up_limited);
|
||||
groups_map.try_emplace(name.quark(), std::move(group_map));
|
||||
}
|
||||
|
||||
|
||||
@@ -1266,10 +1266,10 @@ public:
|
||||
/// constexpr fields
|
||||
|
||||
static constexpr std::array<std::tuple<tr_quark, tr_quark, TrScript>, 3> Scripts{
|
||||
{ { TR_KEY_script_torrent_added_enabled, TR_KEY_script_torrent_added_filename, TR_SCRIPT_ON_TORRENT_ADDED },
|
||||
{ TR_KEY_script_torrent_done_enabled, TR_KEY_script_torrent_done_filename, TR_SCRIPT_ON_TORRENT_DONE },
|
||||
{ TR_KEY_script_torrent_done_seeding_enabled,
|
||||
TR_KEY_script_torrent_done_seeding_filename,
|
||||
{ { TR_KEY_script_torrent_added_enabled_kebab, TR_KEY_script_torrent_added_filename_kebab, TR_SCRIPT_ON_TORRENT_ADDED },
|
||||
{ TR_KEY_script_torrent_done_enabled_kebab, TR_KEY_script_torrent_done_filename_kebab, TR_SCRIPT_ON_TORRENT_DONE },
|
||||
{ TR_KEY_script_torrent_done_seeding_enabled_kebab,
|
||||
TR_KEY_script_torrent_done_seeding_filename_kebab,
|
||||
TR_SCRIPT_ON_TORRENT_DONE_SEEDING } }
|
||||
};
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// or any future license endorsed by Mnemosyne LLC.
|
||||
// License text can be found in the licenses/ folder.
|
||||
|
||||
#include <initializer_list>
|
||||
#include <optional>
|
||||
#include <utility>
|
||||
|
||||
@@ -51,9 +52,9 @@ tr_session_stats tr_stats::load_old_stats(std::string_view config_dir)
|
||||
return {};
|
||||
}
|
||||
|
||||
auto const load = [map](tr_quark const quark, uint64_t& dst)
|
||||
auto const load = [map](std::initializer_list<tr_quark> keys, uint64_t& dst)
|
||||
{
|
||||
if (auto const val = map->value_if<int64_t>(quark); val)
|
||||
if (auto const val = map->value_if<int64_t>(keys); val)
|
||||
{
|
||||
dst = *val;
|
||||
}
|
||||
@@ -61,11 +62,11 @@ tr_session_stats tr_stats::load_old_stats(std::string_view config_dir)
|
||||
|
||||
auto ret = tr_session_stats{};
|
||||
|
||||
load(TR_KEY_downloaded_bytes, ret.downloadedBytes);
|
||||
load(TR_KEY_files_added, ret.filesAdded);
|
||||
load(TR_KEY_seconds_active, ret.secondsActive);
|
||||
load(TR_KEY_session_count, ret.sessionCount);
|
||||
load(TR_KEY_uploaded_bytes, ret.uploadedBytes);
|
||||
load({ TR_KEY_downloaded_bytes, TR_KEY_downloaded_bytes_kebab }, ret.downloadedBytes);
|
||||
load({ TR_KEY_files_added, TR_KEY_files_added_kebab }, ret.filesAdded);
|
||||
load({ TR_KEY_seconds_active, TR_KEY_seconds_active_kebab }, ret.secondsActive);
|
||||
load({ TR_KEY_session_count, TR_KEY_session_count_kebab }, ret.sessionCount);
|
||||
load({ TR_KEY_uploaded_bytes, TR_KEY_uploaded_bytes_kebab }, ret.uploadedBytes);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -376,7 +376,7 @@ enum tr_rpc_callback_type : uint8_t
|
||||
TR_RPC_TORRENT_STOPPED,
|
||||
TR_RPC_TORRENT_REMOVING,
|
||||
TR_RPC_TORRENT_TRASHING, /* _REMOVING + delete local data */
|
||||
TR_RPC_TORRENT_CHANGED, /* catch-all for the "torrent-set" rpc method */
|
||||
TR_RPC_TORRENT_CHANGED, /* catch-all for the "torrent_set" rpc method */
|
||||
TR_RPC_TORRENT_MOVED,
|
||||
TR_RPC_SESSION_CHANGED,
|
||||
TR_RPC_SESSION_QUEUE_POSITIONS_CHANGED, /* catch potentially multiple torrents being moved in the queue */
|
||||
@@ -725,11 +725,11 @@ void tr_blocklistSetEnabled(tr_session* session, bool is_enabled);
|
||||
char const* tr_blocklistGetURL(tr_session const* session);
|
||||
|
||||
/** @brief The blocklist that gets updated when an RPC client
|
||||
invokes the "blocklist-update" method */
|
||||
invokes the "blocklist_update" method */
|
||||
void tr_blocklistSetURL(tr_session* session, char const* url);
|
||||
|
||||
/** @brief the file in the $config/blocklists/ directory that's
|
||||
used by `tr_blocklistSetContent()` and "blocklist-update" */
|
||||
used by `tr_blocklistSetContent()` and "blocklist_update" */
|
||||
#define DEFAULT_BLOCKLIST_FILENAME "blocklist.bin"
|
||||
|
||||
/** @} */
|
||||
|
||||
@@ -253,7 +253,7 @@ void tr_variant::Merge::operator()(tr_variant::Map const& src)
|
||||
tgt->reserve(std::size(*tgt) + std::size(src));
|
||||
for (auto const& [key, val] : src)
|
||||
{
|
||||
std::visit(Merge{ (*tgt)[key] }, val.val_);
|
||||
std::visit(Merge{ (*tgt)[tr_quark_convert(key)] }, val.val_);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <algorithm> // std::move()
|
||||
#include <cstddef> // size_t
|
||||
#include <cstdint> // int64_t
|
||||
#include <initializer_list>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
@@ -95,11 +96,21 @@ public:
|
||||
|
||||
[[nodiscard]] TR_CONSTEXPR20 auto find(tr_quark const key) const noexcept
|
||||
{
|
||||
auto const predicate = [key](auto const& item)
|
||||
return Vector::const_iterator{ const_cast<Map*>(this)->find(key) };
|
||||
}
|
||||
|
||||
[[nodiscard]] TR_CONSTEXPR20 auto find(std::initializer_list<tr_quark> keys) noexcept
|
||||
{
|
||||
static auto constexpr Predicate = [](auto const& item, tr_quark key)
|
||||
{
|
||||
return item.first == key;
|
||||
};
|
||||
return std::find_if(std::cbegin(vec_), std::cend(vec_), predicate);
|
||||
return std::find_first_of(std::begin(vec_), std::end(vec_), std::begin(keys), std::end(keys), Predicate);
|
||||
}
|
||||
|
||||
[[nodiscard]] TR_CONSTEXPR20 auto find(std::initializer_list<tr_quark> keys) const noexcept
|
||||
{
|
||||
return Vector::const_iterator{ const_cast<Map*>(this)->find(keys) };
|
||||
}
|
||||
|
||||
[[nodiscard]] TR_CONSTEXPR20 auto size() const noexcept
|
||||
@@ -163,19 +174,31 @@ public:
|
||||
// --- custom functions
|
||||
|
||||
template<typename Type>
|
||||
[[nodiscard]] TR_CONSTEXPR20 auto find_if(tr_quark const key) noexcept
|
||||
[[nodiscard]] TR_CONSTEXPR20 auto* find_if(tr_quark const key) noexcept
|
||||
{
|
||||
auto const iter = find(key);
|
||||
return iter != end() ? iter->second.get_if<Type>() : nullptr;
|
||||
}
|
||||
|
||||
template<typename Type>
|
||||
[[nodiscard]] TR_CONSTEXPR20 auto find_if(tr_quark const key) const noexcept
|
||||
[[nodiscard]] TR_CONSTEXPR20 auto const* find_if(tr_quark const key) const noexcept
|
||||
{
|
||||
auto const iter = find(key);
|
||||
return const_cast<Map*>(this)->find_if<Type>(key);
|
||||
}
|
||||
|
||||
template<typename Type>
|
||||
[[nodiscard]] TR_CONSTEXPR20 auto* find_if(std::initializer_list<tr_quark> keys) noexcept
|
||||
{
|
||||
auto const iter = find(keys);
|
||||
return iter != end() ? iter->second.get_if<Type>() : nullptr;
|
||||
}
|
||||
|
||||
template<typename Type>
|
||||
[[nodiscard]] TR_CONSTEXPR20 auto* find_if(std::initializer_list<tr_quark> keys) const noexcept
|
||||
{
|
||||
return const_cast<Map*>(this)->find_if<Type>(keys);
|
||||
}
|
||||
|
||||
template<typename Type>
|
||||
[[nodiscard]] std::optional<Type> value_if(tr_quark const key) const noexcept
|
||||
{
|
||||
@@ -187,6 +210,17 @@ public:
|
||||
return {};
|
||||
}
|
||||
|
||||
template<typename Type>
|
||||
[[nodiscard]] std::optional<Type> value_if(std::initializer_list<tr_quark> keys) const noexcept
|
||||
{
|
||||
if (auto it = find(keys); it != end())
|
||||
{
|
||||
return it->second.value_if<Type>();
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
private:
|
||||
using Vector = std::vector<std::pair<tr_quark, tr_variant>>;
|
||||
Vector vec_;
|
||||
|
||||
15
news/news-5.0.0-draft.md
Normal file
15
news/news-5.0.0-draft.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# Transmission 5.0.0 (DRAFT PLEASE IGNORE)
|
||||
|
||||
## Upgrading from older versions
|
||||
|
||||
Please follow the upgrade instructions below to ensure no loss of settings and program state.
|
||||
|
||||
### From 4.1.0 or above
|
||||
|
||||
Safe to upgrade directly to `5.0.0`.
|
||||
|
||||
### From below 4.1.0
|
||||
|
||||
1. Upgrade to a version that's at least `4.1.0`, but below `5.0.0` or any of its alphas/betas/RC.
|
||||
2. Start and stop Transmission.
|
||||
3. Upgrade to `5.0.0`.
|
||||
@@ -96,13 +96,13 @@ constexpr tr_quark priorityKey(int priority)
|
||||
switch (priority)
|
||||
{
|
||||
case TR_PRI_LOW:
|
||||
return TR_KEY_priority_low;
|
||||
return TR_KEY_priority_low_kebab;
|
||||
|
||||
case TR_PRI_HIGH:
|
||||
return TR_KEY_priority_high;
|
||||
return TR_KEY_priority_high_kebab;
|
||||
|
||||
default:
|
||||
return TR_KEY_priority_normal;
|
||||
return TR_KEY_priority_normal_kebab;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1347,12 +1347,12 @@ void DetailsDialog::onShowBackupTrackersToggled(bool val)
|
||||
|
||||
void DetailsDialog::onHonorsSessionLimitsToggled(bool val)
|
||||
{
|
||||
torrentSet(TR_KEY_honorsSessionLimits, val);
|
||||
torrentSet(TR_KEY_honors_session_limits_camel, val);
|
||||
}
|
||||
|
||||
void DetailsDialog::onDownloadLimitedToggled(bool val)
|
||||
{
|
||||
torrentSet(TR_KEY_downloadLimited, val);
|
||||
torrentSet(TR_KEY_download_limited_camel, val);
|
||||
}
|
||||
|
||||
void DetailsDialog::onSpinBoxEditingFinished()
|
||||
@@ -1373,13 +1373,13 @@ void DetailsDialog::onSpinBoxEditingFinished()
|
||||
|
||||
void DetailsDialog::onUploadLimitedToggled(bool val)
|
||||
{
|
||||
torrentSet(TR_KEY_uploadLimited, val);
|
||||
torrentSet(TR_KEY_upload_limited_camel, val);
|
||||
}
|
||||
|
||||
void DetailsDialog::onIdleModeChanged(int index)
|
||||
{
|
||||
int const val = ui_.idleCombo->itemData(index).toInt();
|
||||
torrentSet(TR_KEY_seedIdleMode, val);
|
||||
torrentSet(TR_KEY_seed_idle_mode_camel, val);
|
||||
}
|
||||
|
||||
void DetailsDialog::onIdleLimitChanged()
|
||||
@@ -1393,7 +1393,7 @@ void DetailsDialog::onIdleLimitChanged()
|
||||
void DetailsDialog::onRatioModeChanged(int index)
|
||||
{
|
||||
int const val = ui_.ratioCombo->itemData(index).toInt();
|
||||
torrentSet(TR_KEY_seedRatioMode, val);
|
||||
torrentSet(TR_KEY_seed_ratio_mode_camel, val);
|
||||
}
|
||||
|
||||
void DetailsDialog::onBandwidthPriorityChanged(int index)
|
||||
@@ -1401,7 +1401,7 @@ void DetailsDialog::onBandwidthPriorityChanged(int index)
|
||||
if (index != -1)
|
||||
{
|
||||
int const priority = ui_.bandwidthPriorityCombo->itemData(index).toInt();
|
||||
torrentSet(TR_KEY_bandwidthPriority, priority);
|
||||
torrentSet(TR_KEY_bandwidth_priority_camel, priority);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1467,14 +1467,14 @@ void DetailsDialog::onAddTrackerClicked()
|
||||
urls_list << url;
|
||||
}
|
||||
|
||||
torrentSet(torrent_ids_t{ std::begin(ids), std::end(ids) }, TR_KEY_trackerAdd, urls_list);
|
||||
torrentSet(torrent_ids_t{ std::begin(ids), std::end(ids) }, TR_KEY_tracker_add_camel, urls_list);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DetailsDialog::onTrackerListEdited(QString tracker_list)
|
||||
{
|
||||
torrentSet(TR_KEY_trackerList, tracker_list);
|
||||
torrentSet(TR_KEY_tracker_list_camel, tracker_list);
|
||||
}
|
||||
|
||||
void DetailsDialog::onEditTrackersClicked()
|
||||
@@ -1514,7 +1514,7 @@ void DetailsDialog::onRemoveTrackerClicked()
|
||||
{
|
||||
auto const ids = torrent_ids_t{ torrent_id };
|
||||
auto const values = std::vector<int>{ std::begin(tracker_ids), std::end(tracker_ids) };
|
||||
torrentSet(ids, TR_KEY_trackerRemove, values);
|
||||
torrentSet(ids, TR_KEY_tracker_remove_camel, values);
|
||||
}
|
||||
|
||||
selection_model->clearSelection();
|
||||
@@ -1526,11 +1526,11 @@ void DetailsDialog::initOptionsTab()
|
||||
ui_.singleDownSpin->setSuffix(speed_unit_suffix);
|
||||
ui_.singleUpSpin->setSuffix(speed_unit_suffix);
|
||||
|
||||
ui_.singleDownSpin->setProperty(PrefKey, TR_KEY_downloadLimit);
|
||||
ui_.singleUpSpin->setProperty(PrefKey, TR_KEY_uploadLimit);
|
||||
ui_.ratioSpin->setProperty(PrefKey, TR_KEY_seedRatioLimit);
|
||||
ui_.idleSpin->setProperty(PrefKey, TR_KEY_seedIdleLimit);
|
||||
ui_.peerLimitSpin->setProperty(PrefKey, TR_KEY_peer_limit);
|
||||
ui_.singleDownSpin->setProperty(PrefKey, TR_KEY_download_limit_camel);
|
||||
ui_.singleUpSpin->setProperty(PrefKey, TR_KEY_upload_limit_camel);
|
||||
ui_.ratioSpin->setProperty(PrefKey, TR_KEY_seed_ratio_limit_camel);
|
||||
ui_.idleSpin->setProperty(PrefKey, TR_KEY_seed_idle_limit_camel);
|
||||
ui_.peerLimitSpin->setProperty(PrefKey, TR_KEY_peer_limit_kebab);
|
||||
|
||||
ui_.bandwidthPriorityCombo->addItem(tr("High"), TR_PRI_HIGH);
|
||||
ui_.bandwidthPriorityCombo->addItem(tr("Normal"), TR_PRI_NORMAL);
|
||||
@@ -1643,7 +1643,7 @@ void DetailsDialog::onFilePriorityChanged(file_indices_t const& indices, int pri
|
||||
|
||||
void DetailsDialog::onFileWantedChanged(file_indices_t const& indices, bool wanted)
|
||||
{
|
||||
tr_quark const key = wanted ? TR_KEY_files_wanted : TR_KEY_files_unwanted;
|
||||
tr_quark const key = wanted ? TR_KEY_files_wanted_kebab : TR_KEY_files_unwanted_kebab;
|
||||
torrentSet(key, std::vector<int>{ std::begin(indices), std::end(indices) });
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ void FreeSpaceLabel::onTimer()
|
||||
[this](RpcResponse const& r)
|
||||
{
|
||||
// update the label
|
||||
if (auto const bytes = dictFind<int64_t>(r.args.get(), TR_KEY_size_bytes); bytes && *bytes > 1)
|
||||
if (auto const bytes = dictFind<int64_t>(r.args.get(), TR_KEY_size_bytes_kebab); bytes && *bytes > 1)
|
||||
{
|
||||
setText(tr("%1 free").arg(Formatter::storage_to_string(*bytes)));
|
||||
}
|
||||
|
||||
@@ -240,7 +240,7 @@ void OptionsDialog::onAccepted()
|
||||
download_dir = ui_.destinationEdit->text();
|
||||
}
|
||||
|
||||
dictAdd(&args, TR_KEY_download_dir, download_dir);
|
||||
dictAdd(&args, TR_KEY_download_dir_kebab, download_dir);
|
||||
|
||||
// paused
|
||||
dictAdd(&args, TR_KEY_paused, !ui_.startCheck->isChecked());
|
||||
@@ -248,14 +248,14 @@ void OptionsDialog::onAccepted()
|
||||
// priority
|
||||
int const index = ui_.priorityCombo->currentIndex();
|
||||
int const priority = ui_.priorityCombo->itemData(index).toInt();
|
||||
dictAdd(&args, TR_KEY_bandwidthPriority, priority);
|
||||
dictAdd(&args, TR_KEY_bandwidth_priority_camel, priority);
|
||||
|
||||
// files-unwanted
|
||||
// files_unwanted
|
||||
auto count = std::count(wanted_.begin(), wanted_.end(), false);
|
||||
|
||||
if (count > 0)
|
||||
{
|
||||
tr_variant* l = tr_variantDictAddList(&args, TR_KEY_files_unwanted, count);
|
||||
tr_variant* l = tr_variantDictAddList(&args, TR_KEY_files_unwanted_kebab, count);
|
||||
|
||||
for (int i = 0, n = wanted_.size(); i < n; ++i)
|
||||
{
|
||||
@@ -266,12 +266,12 @@ void OptionsDialog::onAccepted()
|
||||
}
|
||||
}
|
||||
|
||||
// priority-low
|
||||
// priority_low
|
||||
count = std::count(priorities_.begin(), priorities_.end(), TR_PRI_LOW);
|
||||
|
||||
if (count > 0)
|
||||
{
|
||||
tr_variant* l = tr_variantDictAddList(&args, TR_KEY_priority_low, count);
|
||||
tr_variant* l = tr_variantDictAddList(&args, TR_KEY_priority_low_kebab, count);
|
||||
|
||||
for (int i = 0, n = priorities_.size(); i < n; ++i)
|
||||
{
|
||||
@@ -282,12 +282,12 @@ void OptionsDialog::onAccepted()
|
||||
}
|
||||
}
|
||||
|
||||
// priority-high
|
||||
// priority_high
|
||||
count = std::count(priorities_.begin(), priorities_.end(), TR_PRI_HIGH);
|
||||
|
||||
if (count > 0)
|
||||
{
|
||||
tr_variant* l = tr_variantDictAddList(&args, TR_KEY_priority_high, count);
|
||||
tr_variant* l = tr_variantDictAddList(&args, TR_KEY_priority_high_kebab, count);
|
||||
|
||||
for (int i = 0, n = priorities_.size(); i < n; ++i)
|
||||
{
|
||||
|
||||
202
qt/Prefs.cc
202
qt/Prefs.cc
@@ -60,103 +60,103 @@ void ensureSoundCommandIsAList(tr_variant* dict)
|
||||
|
||||
std::array<Prefs::PrefItem, Prefs::PREFS_COUNT> const Prefs::Items{
|
||||
/* gui settings */
|
||||
PrefItem{ OPTIONS_PROMPT, TR_KEY_show_options_window, QMetaType::Bool },
|
||||
{ OPEN_DIALOG_FOLDER, TR_KEY_open_dialog_dir, QMetaType::QString },
|
||||
{ INHIBIT_HIBERNATION, TR_KEY_inhibit_desktop_hibernation, QMetaType::Bool },
|
||||
{ DIR_WATCH, TR_KEY_watch_dir, QMetaType::QString },
|
||||
{ DIR_WATCH_ENABLED, TR_KEY_watch_dir_enabled, QMetaType::Bool },
|
||||
{ SHOW_TRAY_ICON, TR_KEY_show_notification_area_icon, QMetaType::Bool },
|
||||
{ START_MINIMIZED, TR_KEY_start_minimized, QMetaType::Bool },
|
||||
{ SHOW_NOTIFICATION_ON_ADD, TR_KEY_torrent_added_notification_enabled, QMetaType::Bool },
|
||||
{ SHOW_NOTIFICATION_ON_COMPLETE, TR_KEY_torrent_complete_notification_enabled, QMetaType::Bool },
|
||||
{ ASKQUIT, TR_KEY_prompt_before_exit, QMetaType::Bool },
|
||||
{ SORT_MODE, TR_KEY_sort_mode, CustomVariantType::SortModeType },
|
||||
{ SORT_REVERSED, TR_KEY_sort_reversed, QMetaType::Bool },
|
||||
{ COMPACT_VIEW, TR_KEY_compact_view, QMetaType::Bool },
|
||||
{ FILTERBAR, TR_KEY_show_filterbar, QMetaType::Bool },
|
||||
{ STATUSBAR, TR_KEY_show_statusbar, QMetaType::Bool },
|
||||
{ STATUSBAR_STATS, TR_KEY_statusbar_stats, QMetaType::QString },
|
||||
{ SHOW_TRACKER_SCRAPES, TR_KEY_show_tracker_scrapes, QMetaType::Bool },
|
||||
{ SHOW_BACKUP_TRACKERS, TR_KEY_show_backup_trackers, QMetaType::Bool },
|
||||
{ TOOLBAR, TR_KEY_show_toolbar, QMetaType::Bool },
|
||||
{ BLOCKLIST_DATE, TR_KEY_blocklist_date, QMetaType::QDateTime },
|
||||
{ BLOCKLIST_UPDATES_ENABLED, TR_KEY_blocklist_updates_enabled, QMetaType::Bool },
|
||||
{ MAIN_WINDOW_LAYOUT_ORDER, TR_KEY_main_window_layout_order, QMetaType::QString },
|
||||
{ MAIN_WINDOW_HEIGHT, TR_KEY_main_window_height, QMetaType::Int },
|
||||
{ MAIN_WINDOW_WIDTH, TR_KEY_main_window_width, QMetaType::Int },
|
||||
{ MAIN_WINDOW_X, TR_KEY_main_window_x, QMetaType::Int },
|
||||
{ MAIN_WINDOW_Y, TR_KEY_main_window_y, QMetaType::Int },
|
||||
{ FILTER_MODE, TR_KEY_filter_mode, CustomVariantType::FilterModeType },
|
||||
{ FILTER_TRACKERS, TR_KEY_filter_trackers, QMetaType::QString },
|
||||
{ FILTER_TEXT, TR_KEY_filter_text, QMetaType::QString },
|
||||
{ SESSION_IS_REMOTE, TR_KEY_remote_session_enabled, QMetaType::Bool },
|
||||
{ SESSION_REMOTE_HOST, TR_KEY_remote_session_host, QMetaType::QString },
|
||||
{ SESSION_REMOTE_HTTPS, TR_KEY_remote_session_https, QMetaType::Bool },
|
||||
{ SESSION_REMOTE_PASSWORD, TR_KEY_remote_session_password, QMetaType::QString },
|
||||
{ SESSION_REMOTE_PORT, TR_KEY_remote_session_port, QMetaType::Int },
|
||||
{ SESSION_REMOTE_AUTH, TR_KEY_remote_session_requres_authentication, QMetaType::Bool },
|
||||
{ SESSION_REMOTE_USERNAME, TR_KEY_remote_session_username, QMetaType::QString },
|
||||
PrefItem{ OPTIONS_PROMPT, TR_KEY_show_options_window_kebab, QMetaType::Bool },
|
||||
{ OPEN_DIALOG_FOLDER, TR_KEY_open_dialog_dir_kebab, QMetaType::QString },
|
||||
{ INHIBIT_HIBERNATION, TR_KEY_inhibit_desktop_hibernation_kebab, QMetaType::Bool },
|
||||
{ DIR_WATCH, TR_KEY_watch_dir_kebab, QMetaType::QString },
|
||||
{ DIR_WATCH_ENABLED, TR_KEY_watch_dir_enabled_kebab, QMetaType::Bool },
|
||||
{ SHOW_TRAY_ICON, TR_KEY_show_notification_area_icon_kebab, QMetaType::Bool },
|
||||
{ START_MINIMIZED, TR_KEY_start_minimized_kebab, QMetaType::Bool },
|
||||
{ SHOW_NOTIFICATION_ON_ADD, TR_KEY_torrent_added_notification_enabled_kebab, QMetaType::Bool },
|
||||
{ SHOW_NOTIFICATION_ON_COMPLETE, TR_KEY_torrent_complete_notification_enabled_kebab, QMetaType::Bool },
|
||||
{ ASKQUIT, TR_KEY_prompt_before_exit_kebab, QMetaType::Bool },
|
||||
{ SORT_MODE, TR_KEY_sort_mode_kebab, CustomVariantType::SortModeType },
|
||||
{ SORT_REVERSED, TR_KEY_sort_reversed_kebab, QMetaType::Bool },
|
||||
{ COMPACT_VIEW, TR_KEY_compact_view_kebab, QMetaType::Bool },
|
||||
{ FILTERBAR, TR_KEY_show_filterbar_kebab, QMetaType::Bool },
|
||||
{ STATUSBAR, TR_KEY_show_statusbar_kebab, QMetaType::Bool },
|
||||
{ STATUSBAR_STATS, TR_KEY_statusbar_stats_kebab, QMetaType::QString },
|
||||
{ SHOW_TRACKER_SCRAPES, TR_KEY_show_tracker_scrapes_kebab, QMetaType::Bool },
|
||||
{ SHOW_BACKUP_TRACKERS, TR_KEY_show_backup_trackers_kebab, QMetaType::Bool },
|
||||
{ TOOLBAR, TR_KEY_show_toolbar_kebab, QMetaType::Bool },
|
||||
{ BLOCKLIST_DATE, TR_KEY_blocklist_date_kebab, QMetaType::QDateTime },
|
||||
{ BLOCKLIST_UPDATES_ENABLED, TR_KEY_blocklist_updates_enabled_kebab, QMetaType::Bool },
|
||||
{ MAIN_WINDOW_LAYOUT_ORDER, TR_KEY_main_window_layout_order_kebab, QMetaType::QString },
|
||||
{ MAIN_WINDOW_HEIGHT, TR_KEY_main_window_height_kebab, QMetaType::Int },
|
||||
{ MAIN_WINDOW_WIDTH, TR_KEY_main_window_width_kebab, QMetaType::Int },
|
||||
{ MAIN_WINDOW_X, TR_KEY_main_window_x_kebab, QMetaType::Int },
|
||||
{ MAIN_WINDOW_Y, TR_KEY_main_window_y_kebab, QMetaType::Int },
|
||||
{ FILTER_MODE, TR_KEY_filter_mode_kebab, CustomVariantType::FilterModeType },
|
||||
{ FILTER_TRACKERS, TR_KEY_filter_trackers_kebab, QMetaType::QString },
|
||||
{ FILTER_TEXT, TR_KEY_filter_text_kebab, QMetaType::QString },
|
||||
{ SESSION_IS_REMOTE, TR_KEY_remote_session_enabled_kebab, QMetaType::Bool },
|
||||
{ SESSION_REMOTE_HOST, TR_KEY_remote_session_host_kebab, QMetaType::QString },
|
||||
{ SESSION_REMOTE_HTTPS, TR_KEY_remote_session_https_kebab, QMetaType::Bool },
|
||||
{ SESSION_REMOTE_PASSWORD, TR_KEY_remote_session_password_kebab, QMetaType::QString },
|
||||
{ SESSION_REMOTE_PORT, TR_KEY_remote_session_port_kebab, QMetaType::Int },
|
||||
{ SESSION_REMOTE_AUTH, TR_KEY_remote_session_requres_authentication_kebab, QMetaType::Bool },
|
||||
{ SESSION_REMOTE_USERNAME, TR_KEY_remote_session_username_kebab, QMetaType::QString },
|
||||
{ SESSION_REMOTE_RPC_URL_PATH, TR_KEY_remote_session_rpc_url_path, QMetaType::QString },
|
||||
{ COMPLETE_SOUND_COMMAND, TR_KEY_torrent_complete_sound_command, QMetaType::QStringList },
|
||||
{ COMPLETE_SOUND_ENABLED, TR_KEY_torrent_complete_sound_enabled, QMetaType::Bool },
|
||||
{ USER_HAS_GIVEN_INFORMED_CONSENT, TR_KEY_user_has_given_informed_consent, QMetaType::Bool },
|
||||
{ READ_CLIPBOARD, TR_KEY_read_clipboard, QMetaType::Bool },
|
||||
{ COMPLETE_SOUND_COMMAND, TR_KEY_torrent_complete_sound_command_kebab, QMetaType::QStringList },
|
||||
{ COMPLETE_SOUND_ENABLED, TR_KEY_torrent_complete_sound_enabled_kebab, QMetaType::Bool },
|
||||
{ USER_HAS_GIVEN_INFORMED_CONSENT, TR_KEY_user_has_given_informed_consent_kebab, QMetaType::Bool },
|
||||
{ READ_CLIPBOARD, TR_KEY_read_clipboard_kebab, QMetaType::Bool },
|
||||
|
||||
/* libtransmission settings */
|
||||
{ ALT_SPEED_LIMIT_UP, TR_KEY_alt_speed_up, QMetaType::Int },
|
||||
{ ALT_SPEED_LIMIT_DOWN, TR_KEY_alt_speed_down, QMetaType::Int },
|
||||
{ ALT_SPEED_LIMIT_ENABLED, TR_KEY_alt_speed_enabled, QMetaType::Bool },
|
||||
{ ALT_SPEED_LIMIT_TIME_BEGIN, TR_KEY_alt_speed_time_begin, QMetaType::Int },
|
||||
{ ALT_SPEED_LIMIT_TIME_END, TR_KEY_alt_speed_time_end, QMetaType::Int },
|
||||
{ ALT_SPEED_LIMIT_TIME_ENABLED, TR_KEY_alt_speed_time_enabled, QMetaType::Bool },
|
||||
{ ALT_SPEED_LIMIT_TIME_DAY, TR_KEY_alt_speed_time_day, QMetaType::Int },
|
||||
{ BLOCKLIST_ENABLED, TR_KEY_blocklist_enabled, QMetaType::Bool },
|
||||
{ BLOCKLIST_URL, TR_KEY_blocklist_url, QMetaType::QString },
|
||||
{ DEFAULT_TRACKERS, TR_KEY_default_trackers, QMetaType::QString },
|
||||
{ DSPEED, TR_KEY_speed_limit_down, QMetaType::Int },
|
||||
{ DSPEED_ENABLED, TR_KEY_speed_limit_down_enabled, QMetaType::Bool },
|
||||
{ DOWNLOAD_DIR, TR_KEY_download_dir, QMetaType::QString },
|
||||
{ DOWNLOAD_QUEUE_ENABLED, TR_KEY_download_queue_enabled, QMetaType::Bool },
|
||||
{ DOWNLOAD_QUEUE_SIZE, TR_KEY_download_queue_size, QMetaType::Int },
|
||||
{ ALT_SPEED_LIMIT_UP, TR_KEY_alt_speed_up_kebab, QMetaType::Int },
|
||||
{ ALT_SPEED_LIMIT_DOWN, TR_KEY_alt_speed_down_kebab, QMetaType::Int },
|
||||
{ ALT_SPEED_LIMIT_ENABLED, TR_KEY_alt_speed_enabled_kebab, QMetaType::Bool },
|
||||
{ ALT_SPEED_LIMIT_TIME_BEGIN, TR_KEY_alt_speed_time_begin_kebab, QMetaType::Int },
|
||||
{ ALT_SPEED_LIMIT_TIME_END, TR_KEY_alt_speed_time_end_kebab, QMetaType::Int },
|
||||
{ ALT_SPEED_LIMIT_TIME_ENABLED, TR_KEY_alt_speed_time_enabled_kebab, QMetaType::Bool },
|
||||
{ ALT_SPEED_LIMIT_TIME_DAY, TR_KEY_alt_speed_time_day_kebab, QMetaType::Int },
|
||||
{ BLOCKLIST_ENABLED, TR_KEY_blocklist_enabled_kebab, QMetaType::Bool },
|
||||
{ BLOCKLIST_URL, TR_KEY_blocklist_url_kebab, QMetaType::QString },
|
||||
{ DEFAULT_TRACKERS, TR_KEY_default_trackers_kebab, QMetaType::QString },
|
||||
{ DSPEED, TR_KEY_speed_limit_down_kebab, QMetaType::Int },
|
||||
{ DSPEED_ENABLED, TR_KEY_speed_limit_down_enabled_kebab, QMetaType::Bool },
|
||||
{ DOWNLOAD_DIR, TR_KEY_download_dir_kebab, QMetaType::QString },
|
||||
{ DOWNLOAD_QUEUE_ENABLED, TR_KEY_download_queue_enabled_kebab, QMetaType::Bool },
|
||||
{ DOWNLOAD_QUEUE_SIZE, TR_KEY_download_queue_size_kebab, QMetaType::Int },
|
||||
{ ENCRYPTION, TR_KEY_encryption, QMetaType::Int },
|
||||
{ IDLE_LIMIT, TR_KEY_idle_seeding_limit, QMetaType::Int },
|
||||
{ IDLE_LIMIT_ENABLED, TR_KEY_idle_seeding_limit_enabled, QMetaType::Bool },
|
||||
{ INCOMPLETE_DIR, TR_KEY_incomplete_dir, QMetaType::QString },
|
||||
{ INCOMPLETE_DIR_ENABLED, TR_KEY_incomplete_dir_enabled, QMetaType::Bool },
|
||||
{ MSGLEVEL, TR_KEY_message_level, QMetaType::Int },
|
||||
{ PEER_LIMIT_GLOBAL, TR_KEY_peer_limit_global, QMetaType::Int },
|
||||
{ PEER_LIMIT_TORRENT, TR_KEY_peer_limit_per_torrent, QMetaType::Int },
|
||||
{ PEER_PORT, TR_KEY_peer_port, QMetaType::Int },
|
||||
{ PEER_PORT_RANDOM_ON_START, TR_KEY_peer_port_random_on_start, QMetaType::Bool },
|
||||
{ PEER_PORT_RANDOM_LOW, TR_KEY_peer_port_random_low, QMetaType::Int },
|
||||
{ PEER_PORT_RANDOM_HIGH, TR_KEY_peer_port_random_high, QMetaType::Int },
|
||||
{ QUEUE_STALLED_MINUTES, TR_KEY_queue_stalled_minutes, QMetaType::Int },
|
||||
{ SCRIPT_TORRENT_DONE_ENABLED, TR_KEY_script_torrent_done_enabled, QMetaType::Bool },
|
||||
{ SCRIPT_TORRENT_DONE_FILENAME, TR_KEY_script_torrent_done_filename, QMetaType::QString },
|
||||
{ SCRIPT_TORRENT_DONE_SEEDING_ENABLED, TR_KEY_script_torrent_done_seeding_enabled, QMetaType::Bool },
|
||||
{ SCRIPT_TORRENT_DONE_SEEDING_FILENAME, TR_KEY_script_torrent_done_seeding_filename, QMetaType::QString },
|
||||
{ SOCKET_TOS, TR_KEY_peer_socket_tos, QMetaType::QString },
|
||||
{ START, TR_KEY_start_added_torrents, QMetaType::Bool },
|
||||
{ TRASH_ORIGINAL, TR_KEY_trash_original_torrent_files, QMetaType::Bool },
|
||||
{ PEX_ENABLED, TR_KEY_pex_enabled, QMetaType::Bool },
|
||||
{ DHT_ENABLED, TR_KEY_dht_enabled, QMetaType::Bool },
|
||||
{ UTP_ENABLED, TR_KEY_utp_enabled, QMetaType::Bool },
|
||||
{ LPD_ENABLED, TR_KEY_lpd_enabled, QMetaType::Bool },
|
||||
{ PORT_FORWARDING, TR_KEY_port_forwarding_enabled, QMetaType::Bool },
|
||||
{ IDLE_LIMIT, TR_KEY_idle_seeding_limit_kebab, QMetaType::Int },
|
||||
{ IDLE_LIMIT_ENABLED, TR_KEY_idle_seeding_limit_enabled_kebab, QMetaType::Bool },
|
||||
{ INCOMPLETE_DIR, TR_KEY_incomplete_dir_kebab, QMetaType::QString },
|
||||
{ INCOMPLETE_DIR_ENABLED, TR_KEY_incomplete_dir_enabled_kebab, QMetaType::Bool },
|
||||
{ MSGLEVEL, TR_KEY_message_level_kebab, QMetaType::Int },
|
||||
{ PEER_LIMIT_GLOBAL, TR_KEY_peer_limit_global_kebab, QMetaType::Int },
|
||||
{ PEER_LIMIT_TORRENT, TR_KEY_peer_limit_per_torrent_kebab, QMetaType::Int },
|
||||
{ PEER_PORT, TR_KEY_peer_port_kebab, QMetaType::Int },
|
||||
{ PEER_PORT_RANDOM_ON_START, TR_KEY_peer_port_random_on_start_kebab, QMetaType::Bool },
|
||||
{ PEER_PORT_RANDOM_LOW, TR_KEY_peer_port_random_low_kebab, QMetaType::Int },
|
||||
{ PEER_PORT_RANDOM_HIGH, TR_KEY_peer_port_random_high_kebab, QMetaType::Int },
|
||||
{ QUEUE_STALLED_MINUTES, TR_KEY_queue_stalled_minutes_kebab, QMetaType::Int },
|
||||
{ SCRIPT_TORRENT_DONE_ENABLED, TR_KEY_script_torrent_done_enabled_kebab, QMetaType::Bool },
|
||||
{ SCRIPT_TORRENT_DONE_FILENAME, TR_KEY_script_torrent_done_filename_kebab, QMetaType::QString },
|
||||
{ SCRIPT_TORRENT_DONE_SEEDING_ENABLED, TR_KEY_script_torrent_done_seeding_enabled_kebab, QMetaType::Bool },
|
||||
{ SCRIPT_TORRENT_DONE_SEEDING_FILENAME, TR_KEY_script_torrent_done_seeding_filename_kebab, QMetaType::QString },
|
||||
{ SOCKET_TOS, TR_KEY_peer_socket_tos_kebab, QMetaType::QString },
|
||||
{ START, TR_KEY_start_added_torrents_kebab, QMetaType::Bool },
|
||||
{ TRASH_ORIGINAL, TR_KEY_trash_original_torrent_files_kebab, QMetaType::Bool },
|
||||
{ PEX_ENABLED, TR_KEY_pex_enabled_kebab, QMetaType::Bool },
|
||||
{ DHT_ENABLED, TR_KEY_dht_enabled_kebab, QMetaType::Bool },
|
||||
{ UTP_ENABLED, TR_KEY_utp_enabled_kebab, QMetaType::Bool },
|
||||
{ LPD_ENABLED, TR_KEY_lpd_enabled_kebab, QMetaType::Bool },
|
||||
{ PORT_FORWARDING, TR_KEY_port_forwarding_enabled_kebab, QMetaType::Bool },
|
||||
{ PREALLOCATION, TR_KEY_preallocation, QMetaType::Int },
|
||||
{ RATIO, TR_KEY_ratio_limit, QMetaType::Double },
|
||||
{ RATIO_ENABLED, TR_KEY_ratio_limit_enabled, QMetaType::Bool },
|
||||
{ RENAME_PARTIAL_FILES, TR_KEY_rename_partial_files, QMetaType::Bool },
|
||||
{ RPC_AUTH_REQUIRED, TR_KEY_rpc_authentication_required, QMetaType::Bool },
|
||||
{ RPC_ENABLED, TR_KEY_rpc_enabled, QMetaType::Bool },
|
||||
{ RPC_PASSWORD, TR_KEY_rpc_password, QMetaType::QString },
|
||||
{ RPC_PORT, TR_KEY_rpc_port, QMetaType::Int },
|
||||
{ RPC_USERNAME, TR_KEY_rpc_username, QMetaType::QString },
|
||||
{ RPC_WHITELIST_ENABLED, TR_KEY_rpc_whitelist_enabled, QMetaType::Bool },
|
||||
{ RPC_WHITELIST, TR_KEY_rpc_whitelist, QMetaType::QString },
|
||||
{ USPEED_ENABLED, TR_KEY_speed_limit_up_enabled, QMetaType::Bool },
|
||||
{ USPEED, TR_KEY_speed_limit_up, QMetaType::Int },
|
||||
{ UPLOAD_SLOTS_PER_TORRENT, TR_KEY_upload_slots_per_torrent, QMetaType::Int },
|
||||
{ RATIO, TR_KEY_ratio_limit_kebab, QMetaType::Double },
|
||||
{ RATIO_ENABLED, TR_KEY_ratio_limit_enabled_kebab, QMetaType::Bool },
|
||||
{ RENAME_PARTIAL_FILES, TR_KEY_rename_partial_files_kebab, QMetaType::Bool },
|
||||
{ RPC_AUTH_REQUIRED, TR_KEY_rpc_authentication_required_kebab, QMetaType::Bool },
|
||||
{ RPC_ENABLED, TR_KEY_rpc_enabled_kebab, QMetaType::Bool },
|
||||
{ RPC_PASSWORD, TR_KEY_rpc_password_kebab, QMetaType::QString },
|
||||
{ RPC_PORT, TR_KEY_rpc_port_kebab, QMetaType::Int },
|
||||
{ RPC_USERNAME, TR_KEY_rpc_username_kebab, QMetaType::QString },
|
||||
{ RPC_WHITELIST_ENABLED, TR_KEY_rpc_whitelist_enabled_kebab, QMetaType::Bool },
|
||||
{ RPC_WHITELIST, TR_KEY_rpc_whitelist_kebab, QMetaType::QString },
|
||||
{ USPEED_ENABLED, TR_KEY_speed_limit_up_enabled_kebab, QMetaType::Bool },
|
||||
{ USPEED, TR_KEY_speed_limit_up_kebab, QMetaType::Int },
|
||||
{ UPLOAD_SLOTS_PER_TORRENT, TR_KEY_upload_slots_per_torrent_kebab, QMetaType::Int },
|
||||
};
|
||||
|
||||
namespace
|
||||
@@ -242,7 +242,7 @@ Prefs::Prefs(QString config_dir)
|
||||
|
||||
for (int i = 0; i < PREFS_COUNT; ++i)
|
||||
{
|
||||
tr_variant const* b = tr_variantDictFind(&settings, Items[i].key);
|
||||
tr_variant const* b = tr_variantDictFind(&settings, tr_quark_convert(getKey(i)));
|
||||
|
||||
switch (Items[i].type)
|
||||
{
|
||||
@@ -340,7 +340,7 @@ Prefs::~Prefs()
|
||||
continue;
|
||||
}
|
||||
|
||||
tr_quark const key = Items[i].key;
|
||||
tr_quark const key = tr_quark_convert(getKey(i));
|
||||
QVariant const& val = values_[i];
|
||||
|
||||
switch (Items[i].type)
|
||||
@@ -411,16 +411,14 @@ Prefs::~Prefs()
|
||||
auto serde = tr_variant_serde::json();
|
||||
auto const file = QFile{ QDir{ config_dir_ }.absoluteFilePath(QStringLiteral("settings.json")) };
|
||||
auto const filename = file.fileName().toStdString();
|
||||
auto settings = serde.parse_file(filename);
|
||||
if (!settings)
|
||||
auto settings = tr_variant::make_map(PREFS_COUNT);
|
||||
if (auto const file_settings = serde.parse_file(filename); file_settings)
|
||||
{
|
||||
auto empty_dict = tr_variant{};
|
||||
tr_variantInitDict(&empty_dict, PREFS_COUNT);
|
||||
settings = std::move(empty_dict);
|
||||
settings.merge(*file_settings);
|
||||
}
|
||||
|
||||
tr_variantMergeDicts(&*settings, ¤t_settings);
|
||||
serde.to_file(*settings, filename);
|
||||
settings.merge(current_settings);
|
||||
serde.to_file(settings, filename);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -445,7 +443,7 @@ tr_variant Prefs::get_default_app_settings()
|
||||
settings.try_emplace(TR_KEY_inhibit_desktop_hibernation, false);
|
||||
settings.try_emplace(TR_KEY_prompt_before_exit, true);
|
||||
settings.try_emplace(TR_KEY_remote_session_enabled, false);
|
||||
settings.try_emplace(TR_KEY_remote_session_requres_authentication, false);
|
||||
settings.try_emplace(TR_KEY_remote_session_requires_authentication, false);
|
||||
settings.try_emplace(TR_KEY_show_backup_trackers, false);
|
||||
settings.try_emplace(TR_KEY_show_filterbar, true);
|
||||
settings.try_emplace(TR_KEY_show_notification_area_icon, false);
|
||||
|
||||
@@ -460,7 +460,7 @@ void PrefsDialog::updatePortStatusLabel()
|
||||
void PrefsDialog::portTestSetEnabled()
|
||||
{
|
||||
// Depend on the RPC call status instead of the UI status, so that the widgets
|
||||
// won't be enabled even if the port peer port changed while we have port-test
|
||||
// won't be enabled even if the port peer port changed while we have port_test
|
||||
// RPC call(s) in-flight.
|
||||
auto const sensitive = !session_.portTestPending(Session::PORT_TEST_IPV4) &&
|
||||
!session_.portTestPending(Session::PORT_TEST_IPV6);
|
||||
@@ -485,7 +485,7 @@ void PrefsDialog::onPortTested(std::optional<bool> result, Session::PortTestIpPr
|
||||
|
||||
// Only update the UI if the current status is "checking", so that
|
||||
// we won't show the port test results for the old peer port if it
|
||||
// changed while we have port-test RPC call(s) in-flight.
|
||||
// changed while we have port_test RPC call(s) in-flight.
|
||||
if (port_test_status_[ip_protocol] == PORT_TEST_CHECKING)
|
||||
{
|
||||
port_test_status_[ip_protocol] = StatusFromResult(result);
|
||||
|
||||
155
qt/Session.cc
155
qt/Session.cc
@@ -103,7 +103,7 @@ void Session::portTest(Session::PortTestIpProtocol const ip_protocol)
|
||||
// If for whatever reason the status optional is empty here,
|
||||
// then something must have gone wrong with the port test,
|
||||
// so the UI should show the "error" state
|
||||
emit portTested(dictFind<bool>(r.args.get(), TR_KEY_port_is_open), ip_protocol);
|
||||
emit portTested(dictFind<bool>(r.args.get(), TR_KEY_port_is_open_kebab), ip_protocol);
|
||||
};
|
||||
|
||||
auto* q = new RpcQueue{};
|
||||
@@ -122,8 +122,7 @@ bool Session::portTestPending(Session::PortTestIpProtocol const ip_protocol) con
|
||||
|
||||
void Session::copyMagnetLinkToClipboard(int torrent_id)
|
||||
{
|
||||
auto constexpr MagnetLinkKey = std::string_view{ "magnetLink" };
|
||||
auto constexpr Fields = std::array<std::string_view, 1>{ MagnetLinkKey };
|
||||
static auto const Fields = std::array{ tr_quark_get_string_view(TR_KEY_magnet_link_camel) };
|
||||
|
||||
tr_variant args;
|
||||
tr_variantInitDict(&args, 2);
|
||||
@@ -132,7 +131,7 @@ void Session::copyMagnetLinkToClipboard(int torrent_id)
|
||||
|
||||
auto* q = new RpcQueue{};
|
||||
|
||||
q->add([this, &args]() { return exec(TR_KEY_torrent_get, &args); });
|
||||
q->add([this, &args]() { return exec(TR_KEY_torrent_get_kebab, &args); });
|
||||
|
||||
q->add(
|
||||
[](RpcResponse const& r)
|
||||
@@ -146,7 +145,7 @@ void Session::copyMagnetLinkToClipboard(int torrent_id)
|
||||
tr_variant* const child = tr_variantListChild(torrents, 0);
|
||||
if (child != nullptr)
|
||||
{
|
||||
auto const link = dictFind<QString>(child, TR_KEY_magnetLink);
|
||||
auto const link = dictFind<QString>(child, TR_KEY_magnet_link_camel);
|
||||
if (link)
|
||||
{
|
||||
QApplication::clipboard()->setText(*link);
|
||||
@@ -211,11 +210,11 @@ void Session::updatePref(int key)
|
||||
break;
|
||||
|
||||
case Prefs::RATIO:
|
||||
sessionSet(TR_KEY_seedRatioLimit, prefs_.variant(key));
|
||||
sessionSet(TR_KEY_seed_ratio_limit_camel, prefs_.variant(key));
|
||||
break;
|
||||
|
||||
case Prefs::RATIO_ENABLED:
|
||||
sessionSet(TR_KEY_seedRatioLimited, prefs_.variant(key));
|
||||
sessionSet(TR_KEY_seed_ratio_limited_camel, prefs_.variant(key));
|
||||
break;
|
||||
|
||||
case Prefs::ENCRYPTION:
|
||||
@@ -406,7 +405,7 @@ Session::Tag Session::torrentSetImpl(tr_variant* args)
|
||||
auto* const q = new RpcQueue{};
|
||||
auto const tag = q->tag();
|
||||
|
||||
q->add([this, args]() { return rpc_.exec(TR_KEY_torrent_set, args); });
|
||||
q->add([this, args]() { return rpc_.exec(TR_KEY_torrent_set_kebab, args); });
|
||||
q->add([this, tag]() { emit sessionCalled(tag); });
|
||||
q->setTolerateErrors();
|
||||
q->run();
|
||||
@@ -476,7 +475,7 @@ void Session::torrentSetLocation(torrent_ids_t const& torrent_ids, QString const
|
||||
dictAdd(&args, TR_KEY_location, path);
|
||||
dictAdd(&args, TR_KEY_move, do_move);
|
||||
|
||||
exec(TR_KEY_torrent_set_location, &args);
|
||||
exec(TR_KEY_torrent_set_location_kebab, &args);
|
||||
}
|
||||
|
||||
void Session::torrentRenamePath(torrent_ids_t const& torrent_ids, QString const& oldpath, QString const& newname)
|
||||
@@ -523,85 +522,85 @@ std::set<std::string_view> const& Session::getKeyNames(TorrentProperties props)
|
||||
{
|
||||
// unchanging fields needed by the main window
|
||||
static auto constexpr MainInfoKeys = std::array<tr_quark, 9>{
|
||||
TR_KEY_addedDate, //
|
||||
TR_KEY_downloadDir, //
|
||||
TR_KEY_file_count, //
|
||||
TR_KEY_hashString, //
|
||||
TR_KEY_added_date_camel, //
|
||||
TR_KEY_download_dir_camel, //
|
||||
TR_KEY_file_count_kebab, //
|
||||
TR_KEY_hash_string_camel, //
|
||||
TR_KEY_labels, //
|
||||
TR_KEY_name, //
|
||||
TR_KEY_primary_mime_type, //
|
||||
TR_KEY_totalSize, //
|
||||
TR_KEY_primary_mime_type_kebab, //
|
||||
TR_KEY_total_size_camel, //
|
||||
TR_KEY_trackers, //
|
||||
};
|
||||
|
||||
// changing fields needed by the main window
|
||||
static auto constexpr MainStatKeys = std::array<tr_quark, 25>{
|
||||
TR_KEY_downloadedEver,
|
||||
TR_KEY_editDate,
|
||||
TR_KEY_downloaded_ever_camel,
|
||||
TR_KEY_edit_date_camel,
|
||||
TR_KEY_error,
|
||||
TR_KEY_errorString,
|
||||
TR_KEY_error_string_camel,
|
||||
TR_KEY_eta,
|
||||
TR_KEY_haveUnchecked,
|
||||
TR_KEY_haveValid,
|
||||
TR_KEY_isFinished,
|
||||
TR_KEY_leftUntilDone,
|
||||
TR_KEY_manualAnnounceTime,
|
||||
TR_KEY_metadataPercentComplete,
|
||||
TR_KEY_peersConnected,
|
||||
TR_KEY_peersGettingFromUs,
|
||||
TR_KEY_peersSendingToUs,
|
||||
TR_KEY_percentDone,
|
||||
TR_KEY_queuePosition,
|
||||
TR_KEY_rateDownload,
|
||||
TR_KEY_rateUpload,
|
||||
TR_KEY_recheckProgress,
|
||||
TR_KEY_seedRatioLimit,
|
||||
TR_KEY_seedRatioMode,
|
||||
TR_KEY_sizeWhenDone,
|
||||
TR_KEY_have_unchecked_camel,
|
||||
TR_KEY_have_valid_camel,
|
||||
TR_KEY_is_finished_camel,
|
||||
TR_KEY_left_until_done_camel,
|
||||
TR_KEY_manual_announce_time_camel,
|
||||
TR_KEY_metadata_percent_complete_camel,
|
||||
TR_KEY_peers_connected_camel,
|
||||
TR_KEY_peers_getting_from_us_camel,
|
||||
TR_KEY_peers_sending_to_us_camel,
|
||||
TR_KEY_percent_done_camel,
|
||||
TR_KEY_queue_position_camel,
|
||||
TR_KEY_rate_download_camel,
|
||||
TR_KEY_rate_upload_camel,
|
||||
TR_KEY_recheck_progress_camel,
|
||||
TR_KEY_seed_ratio_limit_camel,
|
||||
TR_KEY_seed_ratio_mode_camel,
|
||||
TR_KEY_size_when_done_camel,
|
||||
TR_KEY_status,
|
||||
TR_KEY_uploadedEver,
|
||||
TR_KEY_webseedsSendingToUs,
|
||||
TR_KEY_uploaded_ever_camel,
|
||||
TR_KEY_webseeds_sending_to_us_camel,
|
||||
};
|
||||
|
||||
// unchanging fields needed by the details dialog
|
||||
static auto constexpr DetailInfoKeys = std::array<tr_quark, 10>{
|
||||
TR_KEY_comment, //
|
||||
TR_KEY_creator, //
|
||||
TR_KEY_dateCreated, //
|
||||
TR_KEY_date_created_camel, //
|
||||
TR_KEY_files, //
|
||||
TR_KEY_isPrivate, //
|
||||
TR_KEY_is_private_camel, //
|
||||
TR_KEY_labels, //
|
||||
TR_KEY_pieceCount, //
|
||||
TR_KEY_pieceSize, //
|
||||
TR_KEY_trackerList, //
|
||||
TR_KEY_piece_count_camel, //
|
||||
TR_KEY_piece_size_camel, //
|
||||
TR_KEY_tracker_list_camel, //
|
||||
TR_KEY_trackers, //
|
||||
};
|
||||
|
||||
// changing fields needed by the details dialog
|
||||
static auto constexpr DetailStatKeys = std::array<tr_quark, 18>{
|
||||
TR_KEY_activityDate, //
|
||||
TR_KEY_bandwidthPriority, //
|
||||
TR_KEY_corruptEver, //
|
||||
TR_KEY_desiredAvailable, //
|
||||
TR_KEY_downloadedEver, //
|
||||
TR_KEY_downloadLimit, //
|
||||
TR_KEY_downloadLimited, //
|
||||
TR_KEY_fileStats, //
|
||||
TR_KEY_haveUnchecked, //
|
||||
TR_KEY_honorsSessionLimits, //
|
||||
TR_KEY_peer_limit, //
|
||||
TR_KEY_activity_date_camel, //
|
||||
TR_KEY_bandwidth_priority_camel, //
|
||||
TR_KEY_corrupt_ever_camel, //
|
||||
TR_KEY_desired_available_camel, //
|
||||
TR_KEY_downloaded_ever_camel, //
|
||||
TR_KEY_download_limit_camel, //
|
||||
TR_KEY_download_limited_camel, //
|
||||
TR_KEY_file_stats_camel, //
|
||||
TR_KEY_have_unchecked_camel, //
|
||||
TR_KEY_honors_session_limits_camel, //
|
||||
TR_KEY_peer_limit_kebab, //
|
||||
TR_KEY_peers, //
|
||||
TR_KEY_seedIdleLimit, //
|
||||
TR_KEY_seedIdleMode, //
|
||||
TR_KEY_startDate, //
|
||||
TR_KEY_trackerStats, //
|
||||
TR_KEY_uploadLimit, //
|
||||
TR_KEY_uploadLimited, //
|
||||
TR_KEY_seed_idle_limit_camel, //
|
||||
TR_KEY_seed_idle_mode_camel, //
|
||||
TR_KEY_start_date_camel, //
|
||||
TR_KEY_tracker_stats_camel, //
|
||||
TR_KEY_upload_limit_camel, //
|
||||
TR_KEY_upload_limited_camel, //
|
||||
};
|
||||
|
||||
// keys needed after renaming a torrent
|
||||
static auto constexpr RenameKeys = std::array<tr_quark, 3>{
|
||||
TR_KEY_fileStats,
|
||||
TR_KEY_file_stats_camel,
|
||||
TR_KEY_files,
|
||||
TR_KEY_name,
|
||||
};
|
||||
@@ -658,7 +657,7 @@ void Session::refreshTorrents(torrent_ids_t const& torrent_ids, TorrentPropertie
|
||||
|
||||
auto* q = new RpcQueue{};
|
||||
|
||||
q->add([this, &args]() { return exec(TR_KEY_torrent_get, &args); });
|
||||
q->add([this, &args]() { return exec(TR_KEY_torrent_get_kebab, &args); });
|
||||
|
||||
bool const all_torrents = std::empty(torrent_ids);
|
||||
|
||||
@@ -790,7 +789,7 @@ void Session::updateBlocklist()
|
||||
q->add(
|
||||
[this](RpcResponse const& r)
|
||||
{
|
||||
if (auto const size = dictFind<int>(r.args.get(), TR_KEY_blocklist_size); size)
|
||||
if (auto const size = dictFind<int>(r.args.get(), TR_KEY_blocklist_size_kebab); size)
|
||||
{
|
||||
setBlocklistSize(*size);
|
||||
}
|
||||
@@ -815,27 +814,27 @@ RpcResponseFuture Session::exec(std::string_view method, tr_variant* args)
|
||||
|
||||
void Session::updateStats(tr_variant* args_dict, tr_session_stats* stats)
|
||||
{
|
||||
if (auto const value = dictFind<uint64_t>(args_dict, TR_KEY_uploadedBytes); value)
|
||||
if (auto const value = dictFind<uint64_t>(args_dict, TR_KEY_uploaded_bytes_camel); value)
|
||||
{
|
||||
stats->uploadedBytes = *value;
|
||||
}
|
||||
|
||||
if (auto const value = dictFind<uint64_t>(args_dict, TR_KEY_downloadedBytes); value)
|
||||
if (auto const value = dictFind<uint64_t>(args_dict, TR_KEY_downloaded_bytes_camel); value)
|
||||
{
|
||||
stats->downloadedBytes = *value;
|
||||
}
|
||||
|
||||
if (auto const value = dictFind<uint64_t>(args_dict, TR_KEY_filesAdded); value)
|
||||
if (auto const value = dictFind<uint64_t>(args_dict, TR_KEY_files_added_camel); value)
|
||||
{
|
||||
stats->filesAdded = *value;
|
||||
}
|
||||
|
||||
if (auto const value = dictFind<uint64_t>(args_dict, TR_KEY_sessionCount); value)
|
||||
if (auto const value = dictFind<uint64_t>(args_dict, TR_KEY_session_count_camel); value)
|
||||
{
|
||||
stats->sessionCount = *value;
|
||||
}
|
||||
|
||||
if (auto const value = dictFind<uint64_t>(args_dict, TR_KEY_secondsActive); value)
|
||||
if (auto const value = dictFind<uint64_t>(args_dict, TR_KEY_seconds_active_camel); value)
|
||||
{
|
||||
stats->secondsActive = *value;
|
||||
}
|
||||
@@ -845,12 +844,12 @@ void Session::updateStats(tr_variant* args_dict, tr_session_stats* stats)
|
||||
|
||||
void Session::updateStats(tr_variant* dict)
|
||||
{
|
||||
if (tr_variant* var = nullptr; tr_variantDictFindDict(dict, TR_KEY_current_stats, &var))
|
||||
if (tr_variant* var = nullptr; tr_variantDictFindDict(dict, TR_KEY_current_stats_kebab, &var))
|
||||
{
|
||||
updateStats(var, &stats_);
|
||||
}
|
||||
|
||||
if (tr_variant* var = nullptr; tr_variantDictFindDict(dict, TR_KEY_cumulative_stats, &var))
|
||||
if (tr_variant* var = nullptr; tr_variantDictFindDict(dict, TR_KEY_cumulative_stats_kebab, &var))
|
||||
{
|
||||
updateStats(var, &cumulative_stats_);
|
||||
}
|
||||
@@ -933,12 +932,12 @@ void Session::updateInfo(tr_variant* args_dict)
|
||||
}
|
||||
}
|
||||
|
||||
if (auto const b = dictFind<bool>(args_dict, TR_KEY_seedRatioLimited); b)
|
||||
if (auto const b = dictFind<bool>(args_dict, TR_KEY_seed_ratio_limited_camel); b)
|
||||
{
|
||||
prefs_.set(Prefs::RATIO_ENABLED, *b);
|
||||
}
|
||||
|
||||
if (auto const x = dictFind<double>(args_dict, TR_KEY_seedRatioLimit); x)
|
||||
if (auto const x = dictFind<double>(args_dict, TR_KEY_seed_ratio_limit_camel); x)
|
||||
{
|
||||
prefs_.set(Prefs::RATIO, *x);
|
||||
}
|
||||
@@ -955,7 +954,7 @@ void Session::updateInfo(tr_variant* args_dict)
|
||||
prefs_.set(Prefs::RPC_WHITELIST, QString::fromUtf8(tr_sessionGetRPCWhitelist(session_)));
|
||||
}
|
||||
|
||||
if (auto const size = dictFind<int>(args_dict, TR_KEY_blocklist_size); size && *size != blocklistSize())
|
||||
if (auto const size = dictFind<int>(args_dict, TR_KEY_blocklist_size_kebab); size && *size != blocklistSize())
|
||||
{
|
||||
setBlocklistSize(*size);
|
||||
}
|
||||
@@ -965,7 +964,7 @@ void Session::updateInfo(tr_variant* args_dict)
|
||||
session_version_ = *str;
|
||||
}
|
||||
|
||||
if (auto const str = dictFind<QString>(args_dict, TR_KEY_session_id); str)
|
||||
if (auto const str = dictFind<QString>(args_dict, TR_KEY_session_id_kebab); str)
|
||||
{
|
||||
session_id_ = *str;
|
||||
is_definitely_local_session_ = tr_session_id::is_local(session_id_.toUtf8().constData());
|
||||
@@ -1036,15 +1035,15 @@ void Session::addTorrent(AddData add_me, tr_variant* args_dict)
|
||||
q->add(
|
||||
[this, add_me](RpcResponse const& r)
|
||||
{
|
||||
if (tr_variant* dup = nullptr; tr_variantDictFindDict(r.args.get(), TR_KEY_torrent_added, &dup))
|
||||
if (tr_variant* dup = nullptr; tr_variantDictFindDict(r.args.get(), TR_KEY_torrent_added_kebab, &dup))
|
||||
{
|
||||
add_me.disposeSourceFile();
|
||||
}
|
||||
else if (tr_variantDictFindDict(r.args.get(), TR_KEY_torrent_duplicate, &dup))
|
||||
else if (tr_variantDictFindDict(r.args.get(), TR_KEY_torrent_duplicate_kebab, &dup))
|
||||
{
|
||||
add_me.disposeSourceFile();
|
||||
|
||||
if (auto const hash = dictFind<QString>(dup, TR_KEY_hashString); hash)
|
||||
if (auto const hash = dictFind<QString>(dup, TR_KEY_hash_string_camel); hash)
|
||||
{
|
||||
duplicates_.try_emplace(add_me.readableShortName(), *hash);
|
||||
duplicates_timer_.start(1000);
|
||||
@@ -1099,7 +1098,7 @@ void Session::addNewlyCreatedTorrent(QString const& filename, QString const& loc
|
||||
|
||||
tr_variant args;
|
||||
tr_variantInitDict(&args, 3);
|
||||
dictAdd(&args, TR_KEY_download_dir, local_path);
|
||||
dictAdd(&args, TR_KEY_download_dir_kebab, local_path);
|
||||
dictAdd(&args, TR_KEY_paused, !prefs_.getBool(Prefs::START));
|
||||
dictAdd(&args, TR_KEY_metainfo, b64);
|
||||
|
||||
@@ -1113,7 +1112,7 @@ void Session::removeTorrents(torrent_ids_t const& ids, bool delete_files)
|
||||
tr_variant args;
|
||||
tr_variantInitDict(&args, 2);
|
||||
addOptionalIds(&args, ids);
|
||||
dictAdd(&args, TR_KEY_delete_local_data, delete_files);
|
||||
dictAdd(&args, TR_KEY_delete_local_data_kebab, delete_files);
|
||||
|
||||
exec("torrent-remove", &args);
|
||||
}
|
||||
|
||||
141
qt/Torrent.cc
141
qt/Torrent.cc
@@ -180,61 +180,106 @@ Torrent::fields_t Torrent::update(tr_quark const* keys, tr_variant const* const*
|
||||
changed.set(bit, field_changed); \
|
||||
break;
|
||||
|
||||
HANDLE_KEY(activityDate, activity_date, ACTIVITY_DATE)
|
||||
HANDLE_KEY(addedDate, added_date, ADDED_DATE)
|
||||
HANDLE_KEY(bandwidthPriority, bandwidth_priority, BANDWIDTH_PRIORITY)
|
||||
HANDLE_KEY(corruptEver, failed_ever, FAILED_EVER)
|
||||
HANDLE_KEY(dateCreated, date_created, DATE_CREATED)
|
||||
HANDLE_KEY(desiredAvailable, desired_available, DESIRED_AVAILABLE)
|
||||
HANDLE_KEY(downloadLimit, download_limit, DOWNLOAD_LIMIT) // KB/s
|
||||
HANDLE_KEY(downloadLimited, download_limited, DOWNLOAD_LIMITED)
|
||||
HANDLE_KEY(downloadedEver, downloaded_ever, DOWNLOADED_EVER)
|
||||
HANDLE_KEY(editDate, edit_date, EDIT_DATE)
|
||||
HANDLE_KEY(activity_date, activity_date, ACTIVITY_DATE)
|
||||
HANDLE_KEY(activity_date_camel, activity_date, ACTIVITY_DATE)
|
||||
HANDLE_KEY(added_date, added_date, ADDED_DATE)
|
||||
HANDLE_KEY(added_date_camel, added_date, ADDED_DATE)
|
||||
HANDLE_KEY(bandwidth_priority, bandwidth_priority, BANDWIDTH_PRIORITY)
|
||||
HANDLE_KEY(bandwidth_priority_camel, bandwidth_priority, BANDWIDTH_PRIORITY)
|
||||
HANDLE_KEY(corrupt_ever, failed_ever, FAILED_EVER)
|
||||
HANDLE_KEY(corrupt_ever_camel, failed_ever, FAILED_EVER)
|
||||
HANDLE_KEY(date_created, date_created, DATE_CREATED)
|
||||
HANDLE_KEY(date_created_camel, date_created, DATE_CREATED)
|
||||
HANDLE_KEY(desired_available, desired_available, DESIRED_AVAILABLE)
|
||||
HANDLE_KEY(desired_available_camel, desired_available, DESIRED_AVAILABLE)
|
||||
HANDLE_KEY(download_limit, download_limit, DOWNLOAD_LIMIT) // KB/s
|
||||
HANDLE_KEY(download_limit_camel, download_limit, DOWNLOAD_LIMIT) // KB/s
|
||||
HANDLE_KEY(download_limited, download_limited, DOWNLOAD_LIMITED)
|
||||
HANDLE_KEY(download_limited_camel, download_limited, DOWNLOAD_LIMITED)
|
||||
HANDLE_KEY(downloaded_ever, downloaded_ever, DOWNLOADED_EVER)
|
||||
HANDLE_KEY(downloaded_ever_camel, downloaded_ever, DOWNLOADED_EVER)
|
||||
HANDLE_KEY(edit_date, edit_date, EDIT_DATE)
|
||||
HANDLE_KEY(error, error, TORRENT_ERROR)
|
||||
HANDLE_KEY(eta, eta, ETA)
|
||||
HANDLE_KEY(fileStats, files, FILES)
|
||||
HANDLE_KEY(file_stats, files, FILES)
|
||||
HANDLE_KEY(file_stats_camel, files, FILES)
|
||||
HANDLE_KEY(files, files, FILES)
|
||||
HANDLE_KEY(file_count, file_count, FILE_COUNT)
|
||||
HANDLE_KEY(hashString, hash, HASH)
|
||||
HANDLE_KEY(haveUnchecked, have_unchecked, HAVE_UNCHECKED)
|
||||
HANDLE_KEY(haveValid, have_verified, HAVE_VERIFIED)
|
||||
HANDLE_KEY(honorsSessionLimits, honors_session_limits, HONORS_SESSION_LIMITS)
|
||||
HANDLE_KEY(isFinished, is_finished, IS_FINISHED)
|
||||
HANDLE_KEY(isPrivate, is_private, IS_PRIVATE)
|
||||
HANDLE_KEY(isStalled, is_stalled, IS_STALLED)
|
||||
HANDLE_KEY(file_count_kebab, file_count, FILE_COUNT)
|
||||
HANDLE_KEY(hash_string, hash, HASH)
|
||||
HANDLE_KEY(hash_string_camel, hash, HASH)
|
||||
HANDLE_KEY(have_unchecked, have_unchecked, HAVE_UNCHECKED)
|
||||
HANDLE_KEY(have_unchecked_camel, have_unchecked, HAVE_UNCHECKED)
|
||||
HANDLE_KEY(have_valid, have_verified, HAVE_VERIFIED)
|
||||
HANDLE_KEY(have_valid_camel, have_verified, HAVE_VERIFIED)
|
||||
HANDLE_KEY(honors_session_limits, honors_session_limits, HONORS_SESSION_LIMITS)
|
||||
HANDLE_KEY(honors_session_limits_camel, honors_session_limits, HONORS_SESSION_LIMITS)
|
||||
HANDLE_KEY(is_finished, is_finished, IS_FINISHED)
|
||||
HANDLE_KEY(is_finished_camel, is_finished, IS_FINISHED)
|
||||
HANDLE_KEY(is_private, is_private, IS_PRIVATE)
|
||||
HANDLE_KEY(is_private_camel, is_private, IS_PRIVATE)
|
||||
HANDLE_KEY(is_stalled, is_stalled, IS_STALLED)
|
||||
HANDLE_KEY(is_stalled_camel, is_stalled, IS_STALLED)
|
||||
HANDLE_KEY(labels, labels, LABELS)
|
||||
HANDLE_KEY(leftUntilDone, left_until_done, LEFT_UNTIL_DONE)
|
||||
HANDLE_KEY(manualAnnounceTime, manual_announce_time, MANUAL_ANNOUNCE_TIME)
|
||||
HANDLE_KEY(metadataPercentComplete, metadata_percent_complete, METADATA_PERCENT_COMPLETE)
|
||||
HANDLE_KEY(left_until_done, left_until_done, LEFT_UNTIL_DONE)
|
||||
HANDLE_KEY(left_until_done_camel, left_until_done, LEFT_UNTIL_DONE)
|
||||
HANDLE_KEY(manual_announce_time, manual_announce_time, MANUAL_ANNOUNCE_TIME)
|
||||
HANDLE_KEY(manual_announce_time_camel, manual_announce_time, MANUAL_ANNOUNCE_TIME)
|
||||
HANDLE_KEY(metadata_percent_complete, metadata_percent_complete, METADATA_PERCENT_COMPLETE)
|
||||
HANDLE_KEY(metadata_percent_complete_camel, metadata_percent_complete, METADATA_PERCENT_COMPLETE)
|
||||
HANDLE_KEY(name, name, NAME)
|
||||
HANDLE_KEY(peer_limit, peer_limit, PEER_LIMIT)
|
||||
HANDLE_KEY(peers, peers, PEERS)
|
||||
HANDLE_KEY(peersConnected, peers_connected, PEERS_CONNECTED)
|
||||
HANDLE_KEY(peersGettingFromUs, peers_getting_from_us, PEERS_GETTING_FROM_US)
|
||||
HANDLE_KEY(peersSendingToUs, peers_sending_to_us, PEERS_SENDING_TO_US)
|
||||
HANDLE_KEY(percentDone, percent_done, PERCENT_DONE)
|
||||
HANDLE_KEY(pieceCount, piece_count, PIECE_COUNT)
|
||||
HANDLE_KEY(pieceSize, piece_size, PIECE_SIZE)
|
||||
HANDLE_KEY(peers_connected, peers_connected, PEERS_CONNECTED)
|
||||
HANDLE_KEY(peers_connected_camel, peers_connected, PEERS_CONNECTED)
|
||||
HANDLE_KEY(peers_getting_from_us, peers_getting_from_us, PEERS_GETTING_FROM_US)
|
||||
HANDLE_KEY(peers_getting_from_us_camel, peers_getting_from_us, PEERS_GETTING_FROM_US)
|
||||
HANDLE_KEY(peers_sending_to_us, peers_sending_to_us, PEERS_SENDING_TO_US)
|
||||
HANDLE_KEY(peers_sending_to_us_camel, peers_sending_to_us, PEERS_SENDING_TO_US)
|
||||
HANDLE_KEY(percent_done, percent_done, PERCENT_DONE)
|
||||
HANDLE_KEY(percent_done_camel, percent_done, PERCENT_DONE)
|
||||
HANDLE_KEY(piece_count, piece_count, PIECE_COUNT)
|
||||
HANDLE_KEY(piece_count_camel, piece_count, PIECE_COUNT)
|
||||
HANDLE_KEY(piece_size, piece_size, PIECE_SIZE)
|
||||
HANDLE_KEY(piece_size_camel, piece_size, PIECE_SIZE)
|
||||
HANDLE_KEY(primary_mime_type, primary_mime_type, PRIMARY_MIME_TYPE)
|
||||
HANDLE_KEY(queuePosition, queue_position, QUEUE_POSITION)
|
||||
HANDLE_KEY(rateDownload, download_speed, DOWNLOAD_SPEED)
|
||||
HANDLE_KEY(rateUpload, upload_speed, UPLOAD_SPEED)
|
||||
HANDLE_KEY(recheckProgress, recheck_progress, RECHECK_PROGRESS)
|
||||
HANDLE_KEY(seedIdleLimit, seed_idle_limit, SEED_IDLE_LIMIT)
|
||||
HANDLE_KEY(seedIdleMode, seed_idle_mode, SEED_IDLE_MODE)
|
||||
HANDLE_KEY(seedRatioLimit, seed_ratio_limit, SEED_RATIO_LIMIT)
|
||||
HANDLE_KEY(seedRatioMode, seed_ratio_mode, SEED_RATIO_MODE)
|
||||
HANDLE_KEY(sizeWhenDone, size_when_done, SIZE_WHEN_DONE)
|
||||
HANDLE_KEY(startDate, start_date, START_DATE)
|
||||
HANDLE_KEY(primary_mime_type_kebab, primary_mime_type, PRIMARY_MIME_TYPE)
|
||||
HANDLE_KEY(queue_position, queue_position, QUEUE_POSITION)
|
||||
HANDLE_KEY(queue_position_camel, queue_position, QUEUE_POSITION)
|
||||
HANDLE_KEY(rate_download, download_speed, DOWNLOAD_SPEED)
|
||||
HANDLE_KEY(rate_download_camel, download_speed, DOWNLOAD_SPEED)
|
||||
HANDLE_KEY(rate_upload, upload_speed, UPLOAD_SPEED)
|
||||
HANDLE_KEY(rate_upload_camel, upload_speed, UPLOAD_SPEED)
|
||||
HANDLE_KEY(recheck_progress, recheck_progress, RECHECK_PROGRESS)
|
||||
HANDLE_KEY(recheck_progress_camel, recheck_progress, RECHECK_PROGRESS)
|
||||
HANDLE_KEY(seed_idle_limit, seed_idle_limit, SEED_IDLE_LIMIT)
|
||||
HANDLE_KEY(seed_idle_limit_camel, seed_idle_limit, SEED_IDLE_LIMIT)
|
||||
HANDLE_KEY(seed_idle_mode, seed_idle_mode, SEED_IDLE_MODE)
|
||||
HANDLE_KEY(seed_idle_mode_camel, seed_idle_mode, SEED_IDLE_MODE)
|
||||
HANDLE_KEY(seed_ratio_limit, seed_ratio_limit, SEED_RATIO_LIMIT)
|
||||
HANDLE_KEY(seed_ratio_limit_camel, seed_ratio_limit, SEED_RATIO_LIMIT)
|
||||
HANDLE_KEY(seed_ratio_mode, seed_ratio_mode, SEED_RATIO_MODE)
|
||||
HANDLE_KEY(seed_ratio_mode_camel, seed_ratio_mode, SEED_RATIO_MODE)
|
||||
HANDLE_KEY(size_when_done, size_when_done, SIZE_WHEN_DONE)
|
||||
HANDLE_KEY(size_when_done_camel, size_when_done, SIZE_WHEN_DONE)
|
||||
HANDLE_KEY(start_date, start_date, START_DATE)
|
||||
HANDLE_KEY(start_date_camel, start_date, START_DATE)
|
||||
HANDLE_KEY(status, status, STATUS)
|
||||
HANDLE_KEY(totalSize, total_size, TOTAL_SIZE)
|
||||
HANDLE_KEY(trackerList, tracker_list, TRACKER_LIST)
|
||||
HANDLE_KEY(trackerStats, tracker_stats, TRACKER_STATS)
|
||||
HANDLE_KEY(total_size, total_size, TOTAL_SIZE)
|
||||
HANDLE_KEY(total_size_camel, total_size, TOTAL_SIZE)
|
||||
HANDLE_KEY(tracker_list, tracker_list, TRACKER_LIST)
|
||||
HANDLE_KEY(tracker_list_camel, tracker_list, TRACKER_LIST)
|
||||
HANDLE_KEY(tracker_stats, tracker_stats, TRACKER_STATS)
|
||||
HANDLE_KEY(tracker_stats_camel, tracker_stats, TRACKER_STATS)
|
||||
HANDLE_KEY(trackers, tracker_stats, TRACKER_STATS)
|
||||
HANDLE_KEY(uploadLimit, upload_limit, UPLOAD_LIMIT) // KB/s
|
||||
HANDLE_KEY(uploadLimited, upload_limited, UPLOAD_LIMITED)
|
||||
HANDLE_KEY(uploadedEver, uploaded_ever, UPLOADED_EVER)
|
||||
HANDLE_KEY(webseedsSendingToUs, webseeds_sending_to_us, WEBSEEDS_SENDING_TO_US)
|
||||
HANDLE_KEY(upload_limit, upload_limit, UPLOAD_LIMIT) // KB/s
|
||||
HANDLE_KEY(upload_limit_camel, upload_limit, UPLOAD_LIMIT) // KB/s
|
||||
HANDLE_KEY(upload_limited, upload_limited, UPLOAD_LIMITED)
|
||||
HANDLE_KEY(upload_limited_camel, upload_limited, UPLOAD_LIMITED)
|
||||
HANDLE_KEY(uploaded_ever, uploaded_ever, UPLOADED_EVER)
|
||||
HANDLE_KEY(uploaded_ever_camel, uploaded_ever, UPLOADED_EVER)
|
||||
HANDLE_KEY(webseeds_sending_to_us, webseeds_sending_to_us, WEBSEEDS_SENDING_TO_US)
|
||||
HANDLE_KEY(webseeds_sending_to_us_camel, webseeds_sending_to_us, WEBSEEDS_SENDING_TO_US)
|
||||
#undef HANDLE_KEY
|
||||
|
||||
#define HANDLE_KEY(key, field, bit) \
|
||||
@@ -249,8 +294,10 @@ Torrent::fields_t Torrent::update(tr_quark const* keys, tr_variant const* const*
|
||||
|
||||
HANDLE_KEY(comment, comment, COMMENT)
|
||||
HANDLE_KEY(creator, creator, CREATOR)
|
||||
HANDLE_KEY(downloadDir, download_dir, DOWNLOAD_DIR)
|
||||
HANDLE_KEY(errorString, error_string, TORRENT_ERROR_STRING)
|
||||
HANDLE_KEY(download_dir, download_dir, DOWNLOAD_DIR)
|
||||
HANDLE_KEY(download_dir_camel, download_dir, DOWNLOAD_DIR)
|
||||
HANDLE_KEY(error_string, error_string, TORRENT_ERROR_STRING)
|
||||
HANDLE_KEY(error_string_camel, error_string, TORRENT_ERROR_STRING)
|
||||
|
||||
#undef HANDLE_KEY
|
||||
default:
|
||||
@@ -262,7 +309,9 @@ Torrent::fields_t Torrent::update(tr_quark const* keys, tr_variant const* const*
|
||||
switch (key)
|
||||
{
|
||||
case TR_KEY_file_count:
|
||||
case TR_KEY_file_count_kebab:
|
||||
case TR_KEY_primary_mime_type:
|
||||
case TR_KEY_primary_mime_type_kebab:
|
||||
icon_ = {};
|
||||
break;
|
||||
|
||||
|
||||
@@ -60,20 +60,20 @@ bool change(Peer& setme, tr_variant const* value)
|
||||
break;
|
||||
|
||||
HANDLE_KEY(address, address)
|
||||
HANDLE_KEY(clientIsChoked, client_is_choked)
|
||||
HANDLE_KEY(clientIsInterested, client_is_interested)
|
||||
HANDLE_KEY(clientName, client_name)
|
||||
HANDLE_KEY(flagStr, flags)
|
||||
HANDLE_KEY(isDownloadingFrom, is_downloading_from)
|
||||
HANDLE_KEY(isEncrypted, is_encrypted)
|
||||
HANDLE_KEY(isIncoming, is_incoming)
|
||||
HANDLE_KEY(isUploadingTo, is_uploading_to)
|
||||
HANDLE_KEY(peerIsChoked, peer_is_choked)
|
||||
HANDLE_KEY(peerIsInterested, peer_is_interested)
|
||||
HANDLE_KEY(client_is_choked_camel, client_is_choked)
|
||||
HANDLE_KEY(client_is_interested_camel, client_is_interested)
|
||||
HANDLE_KEY(client_name_camel, client_name)
|
||||
HANDLE_KEY(flag_str_camel, flags)
|
||||
HANDLE_KEY(is_downloading_from_camel, is_downloading_from)
|
||||
HANDLE_KEY(is_encrypted_camel, is_encrypted)
|
||||
HANDLE_KEY(is_incoming_camel, is_incoming)
|
||||
HANDLE_KEY(is_uploading_to_camel, is_uploading_to)
|
||||
HANDLE_KEY(peer_is_choked_camel, peer_is_choked)
|
||||
HANDLE_KEY(peer_is_interested_camel, peer_is_interested)
|
||||
HANDLE_KEY(port, port)
|
||||
HANDLE_KEY(progress, progress)
|
||||
HANDLE_KEY(rateToClient, rate_to_client)
|
||||
HANDLE_KEY(rateToPeer, rate_to_peer)
|
||||
HANDLE_KEY(rate_to_client_camel, rate_to_client)
|
||||
HANDLE_KEY(rate_to_peer_camel, rate_to_peer)
|
||||
#undef HANDLE_KEY
|
||||
default:
|
||||
break;
|
||||
@@ -108,7 +108,7 @@ bool change(TorrentFile& setme, tr_variant const* value)
|
||||
changed = change(setme.field, child) || changed; \
|
||||
break;
|
||||
|
||||
HANDLE_KEY(bytesCompleted, have)
|
||||
HANDLE_KEY(bytes_completed_camel, have)
|
||||
HANDLE_KEY(length, size)
|
||||
HANDLE_KEY(name, filename)
|
||||
#undef HANDLE_KEY
|
||||
@@ -139,28 +139,28 @@ bool change(TrackerStat& setme, tr_variant const* value)
|
||||
field_changed = change(setme.field, child); \
|
||||
break;
|
||||
HANDLE_KEY(announce, announce)
|
||||
HANDLE_KEY(announceState, announce_state)
|
||||
HANDLE_KEY(downloadCount, download_count)
|
||||
HANDLE_KEY(hasAnnounced, has_announced)
|
||||
HANDLE_KEY(hasScraped, has_scraped)
|
||||
HANDLE_KEY(announce_state_camel, announce_state)
|
||||
HANDLE_KEY(download_count_camel, download_count)
|
||||
HANDLE_KEY(has_announced_camel, has_announced)
|
||||
HANDLE_KEY(has_scraped_camel, has_scraped)
|
||||
HANDLE_KEY(id, id)
|
||||
HANDLE_KEY(isBackup, is_backup)
|
||||
HANDLE_KEY(lastAnnouncePeerCount, last_announce_peer_count)
|
||||
HANDLE_KEY(lastAnnounceResult, last_announce_result)
|
||||
HANDLE_KEY(lastAnnounceStartTime, last_announce_start_time)
|
||||
HANDLE_KEY(lastAnnounceSucceeded, last_announce_succeeded)
|
||||
HANDLE_KEY(lastAnnounceTime, last_announce_time)
|
||||
HANDLE_KEY(lastAnnounceTimedOut, last_announce_timed_out)
|
||||
HANDLE_KEY(lastScrapeResult, last_scrape_result)
|
||||
HANDLE_KEY(lastScrapeStartTime, last_scrape_start_time)
|
||||
HANDLE_KEY(lastScrapeSucceeded, last_scrape_succeeded)
|
||||
HANDLE_KEY(lastScrapeTime, last_scrape_time)
|
||||
HANDLE_KEY(lastScrapeTimedOut, last_scrape_timed_out)
|
||||
HANDLE_KEY(leecherCount, leecher_count)
|
||||
HANDLE_KEY(nextAnnounceTime, next_announce_time)
|
||||
HANDLE_KEY(nextScrapeTime, next_scrape_time)
|
||||
HANDLE_KEY(scrapeState, scrape_state)
|
||||
HANDLE_KEY(seederCount, seeder_count)
|
||||
HANDLE_KEY(is_backup_camel, is_backup)
|
||||
HANDLE_KEY(last_announce_peer_count_camel, last_announce_peer_count)
|
||||
HANDLE_KEY(last_announce_result_camel, last_announce_result)
|
||||
HANDLE_KEY(last_announce_start_time_camel, last_announce_start_time)
|
||||
HANDLE_KEY(last_announce_succeeded_camel, last_announce_succeeded)
|
||||
HANDLE_KEY(last_announce_time_camel, last_announce_time)
|
||||
HANDLE_KEY(last_announce_timed_out_camel, last_announce_timed_out)
|
||||
HANDLE_KEY(last_scrape_result_camel, last_scrape_result)
|
||||
HANDLE_KEY(last_scrape_start_time_camel, last_scrape_start_time)
|
||||
HANDLE_KEY(last_scrape_succeeded_camel, last_scrape_succeeded)
|
||||
HANDLE_KEY(last_scrape_time_camel, last_scrape_time)
|
||||
HANDLE_KEY(last_scrape_timed_out_camel, last_scrape_timed_out)
|
||||
HANDLE_KEY(leecher_count_camel, leecher_count)
|
||||
HANDLE_KEY(next_announce_time_camel, next_announce_time)
|
||||
HANDLE_KEY(next_scrape_time_camel, next_scrape_time)
|
||||
HANDLE_KEY(scrape_state_camel, scrape_state)
|
||||
HANDLE_KEY(seeder_count_camel, seeder_count)
|
||||
HANDLE_KEY(sitename, sitename)
|
||||
HANDLE_KEY(tier, tier)
|
||||
|
||||
|
||||
@@ -300,7 +300,7 @@ TEST_F(CompletionTest, sizeWhenDone)
|
||||
auto constexpr PieceSize = uint64_t{ BlockSize * 64 };
|
||||
auto const block_info = tr_block_info{ TotalSize, PieceSize };
|
||||
|
||||
// check that adding or removing blocks or pieces does not affect sizeWhenDone
|
||||
// check that adding or removing blocks or pieces does not affect size_when_done
|
||||
auto completion = torrent.makeCompletion(block_info);
|
||||
EXPECT_EQ(block_info.total_size(), completion.size_when_done());
|
||||
completion.add_block(0);
|
||||
@@ -310,7 +310,7 @@ TEST_F(CompletionTest, sizeWhenDone)
|
||||
completion.remove_piece(0);
|
||||
EXPECT_EQ(block_info.total_size(), completion.size_when_done());
|
||||
|
||||
// check that flagging complete pieces as dnd does not affect sizeWhenDone
|
||||
// check that flagging complete pieces as dnd does not affect size_when_done
|
||||
for (size_t i = 0; i < 32; ++i)
|
||||
{
|
||||
completion.add_piece(i);
|
||||
@@ -319,7 +319,7 @@ TEST_F(CompletionTest, sizeWhenDone)
|
||||
completion.invalidate_size_when_done();
|
||||
EXPECT_EQ(block_info.total_size(), completion.size_when_done());
|
||||
|
||||
// check that flagging missing pieces as dnd does not affect sizeWhenDone
|
||||
// check that flagging missing pieces as dnd does not affect size_when_done
|
||||
for (size_t i = 32; i < 48; ++i)
|
||||
{
|
||||
torrent.dnd_pieces.insert(i);
|
||||
|
||||
@@ -249,16 +249,16 @@ TEST_P(JSONTest, test3)
|
||||
{
|
||||
static auto constexpr Input =
|
||||
"{ \"error\": 2,"
|
||||
" \"errorString\": \"torrent not registered with this tracker 6UHsVW'*C\","
|
||||
" \"error_string\": \"torrent not registered with this tracker 6UHsVW'*C\","
|
||||
" \"eta\": 262792,"
|
||||
" \"id\": 25,"
|
||||
" \"leftUntilDone\": 2275655680 }"sv;
|
||||
" \"left_until_done\": 2275655680 }"sv;
|
||||
|
||||
auto var = tr_variant_serde::json().inplace().parse(Input).value_or(tr_variant{});
|
||||
auto* map = var.get_if<tr_variant::Map>();
|
||||
ASSERT_NE(map, nullptr);
|
||||
|
||||
auto sv = map->value_if<std::string_view>(TR_KEY_errorString);
|
||||
auto sv = map->value_if<std::string_view>(TR_KEY_error_string);
|
||||
ASSERT_TRUE(sv);
|
||||
EXPECT_EQ("torrent not registered with this tracker 6UHsVW'*C"sv, *sv);
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ TEST_F(RpcTest, NotArrayOrObject)
|
||||
EXPECT_EQ(*error_message, "Invalid Request"sv);
|
||||
auto const error_data = error->find_if<tr_variant::Map>(TR_KEY_data);
|
||||
ASSERT_NE(error_data, nullptr);
|
||||
auto const error_string = error_data->value_if<std::string_view>(TR_KEY_errorString);
|
||||
auto const error_string = error_data->value_if<std::string_view>(TR_KEY_error_string);
|
||||
ASSERT_TRUE(error_string);
|
||||
EXPECT_EQ(*error_string, "request must be an Array or Object"sv);
|
||||
auto const id = response_map->value_if<std::nullptr_t>(TR_KEY_id);
|
||||
@@ -122,7 +122,7 @@ TEST_F(RpcTest, JsonRpcWrongVersion)
|
||||
EXPECT_EQ(*error_message, "Invalid Request"sv);
|
||||
auto const error_data = error->find_if<tr_variant::Map>(TR_KEY_data);
|
||||
ASSERT_NE(error_data, nullptr);
|
||||
auto const error_string = error_data->value_if<std::string_view>(TR_KEY_errorString);
|
||||
auto const error_string = error_data->value_if<std::string_view>(TR_KEY_error_string);
|
||||
ASSERT_TRUE(error_string);
|
||||
EXPECT_EQ(*error_string, "JSON-RPC version is not 2.0"sv);
|
||||
auto const id = response_map->value_if<std::nullptr_t>(TR_KEY_id);
|
||||
@@ -210,7 +210,7 @@ TEST_F(RpcTest, idWrongType)
|
||||
EXPECT_EQ(*error_message, "Invalid Request"sv);
|
||||
auto const error_data = error->find_if<tr_variant::Map>(TR_KEY_data);
|
||||
ASSERT_NE(error_data, nullptr);
|
||||
auto const error_string = error_data->value_if<std::string_view>(TR_KEY_errorString);
|
||||
auto const error_string = error_data->value_if<std::string_view>(TR_KEY_error_string);
|
||||
ASSERT_TRUE(error_string);
|
||||
EXPECT_EQ(*error_string, "id type must be String, Number, or Null"sv);
|
||||
auto const id = response_map->value_if<std::nullptr_t>(TR_KEY_id);
|
||||
@@ -221,7 +221,7 @@ TEST_F(RpcTest, idWrongType)
|
||||
TEST_F(RpcTest, tagSyncLegacy)
|
||||
{
|
||||
auto request_map = tr_variant::Map{ 2U };
|
||||
request_map.try_emplace(TR_KEY_method, "session-stats");
|
||||
request_map.try_emplace(TR_KEY_method, "session_stats");
|
||||
request_map.try_emplace(TR_KEY_tag, 12345);
|
||||
|
||||
auto response = tr_variant{};
|
||||
@@ -306,7 +306,7 @@ TEST_F(RpcTest, tagAsyncLegacy)
|
||||
EXPECT_NE(nullptr, tor);
|
||||
|
||||
auto request_map = tr_variant::Map{ 3U };
|
||||
request_map.try_emplace(TR_KEY_method, "torrent-rename-path");
|
||||
request_map.try_emplace(TR_KEY_method, "torrent_rename_path");
|
||||
request_map.try_emplace(TR_KEY_tag, 12345);
|
||||
|
||||
auto arguments_map = tr_variant::Map{ 2U };
|
||||
@@ -538,7 +538,7 @@ TEST_F(RpcTest, batch)
|
||||
EXPECT_EQ(*error_message, "Invalid Request"sv);
|
||||
auto error_data = error->find_if<tr_variant::Map>(TR_KEY_data);
|
||||
ASSERT_NE(error_data, nullptr);
|
||||
auto error_string = error_data->value_if<std::string_view>(TR_KEY_errorString);
|
||||
auto error_string = error_data->value_if<std::string_view>(TR_KEY_error_string);
|
||||
ASSERT_TRUE(error_string);
|
||||
EXPECT_EQ(*error_string, "request must be an Object"sv);
|
||||
id_null = response_map->value_if<std::nullptr_t>(TR_KEY_id);
|
||||
@@ -574,7 +574,7 @@ TEST_F(RpcTest, batch)
|
||||
EXPECT_EQ(*error_message, "Invalid Request"sv);
|
||||
error_data = error->find_if<tr_variant::Map>(TR_KEY_data);
|
||||
ASSERT_NE(error_data, nullptr);
|
||||
error_string = error_data->value_if<std::string_view>(TR_KEY_errorString);
|
||||
error_string = error_data->value_if<std::string_view>(TR_KEY_error_string);
|
||||
ASSERT_TRUE(error_string);
|
||||
EXPECT_EQ(*error_string, "JSON-RPC version is not 2.0"sv);
|
||||
id_null = response_map->value_if<std::nullptr_t>(TR_KEY_id);
|
||||
@@ -592,7 +592,7 @@ TEST_F(RpcTest, sessionGet)
|
||||
|
||||
auto request_map = tr_variant::Map{ 3U };
|
||||
request_map.try_emplace(TR_KEY_jsonrpc, JsonRpc::Version);
|
||||
request_map.try_emplace(TR_KEY_method, "session-get"sv);
|
||||
request_map.try_emplace(TR_KEY_method, "session_get"sv);
|
||||
request_map.try_emplace(TR_KEY_id, 12345);
|
||||
auto response = tr_variant{};
|
||||
tr_rpc_request_exec(
|
||||
@@ -607,6 +607,13 @@ TEST_F(RpcTest, sessionGet)
|
||||
|
||||
// what we expected
|
||||
static auto constexpr ExpectedKeys = std::array{
|
||||
TR_KEY_alt_speed_down_kebab,
|
||||
TR_KEY_alt_speed_enabled_kebab,
|
||||
TR_KEY_alt_speed_time_begin_kebab,
|
||||
TR_KEY_alt_speed_time_day_kebab,
|
||||
TR_KEY_alt_speed_time_enabled_kebab,
|
||||
TR_KEY_alt_speed_time_end_kebab,
|
||||
TR_KEY_alt_speed_up_kebab,
|
||||
TR_KEY_alt_speed_down,
|
||||
TR_KEY_alt_speed_enabled,
|
||||
TR_KEY_alt_speed_time_begin,
|
||||
@@ -614,59 +621,108 @@ TEST_F(RpcTest, sessionGet)
|
||||
TR_KEY_alt_speed_time_enabled,
|
||||
TR_KEY_alt_speed_time_end,
|
||||
TR_KEY_alt_speed_up,
|
||||
TR_KEY_anti_brute_force_enabled_kebab,
|
||||
TR_KEY_anti_brute_force_threshold_kebab,
|
||||
TR_KEY_anti_brute_force_enabled,
|
||||
TR_KEY_anti_brute_force_threshold,
|
||||
TR_KEY_blocklist_enabled_kebab,
|
||||
TR_KEY_blocklist_size_kebab,
|
||||
TR_KEY_blocklist_url_kebab,
|
||||
TR_KEY_blocklist_enabled,
|
||||
TR_KEY_blocklist_size,
|
||||
TR_KEY_blocklist_url,
|
||||
TR_KEY_cache_size_mb_kebab,
|
||||
TR_KEY_cache_size_mb,
|
||||
TR_KEY_config_dir_kebab,
|
||||
TR_KEY_config_dir,
|
||||
TR_KEY_default_trackers_kebab,
|
||||
TR_KEY_default_trackers,
|
||||
TR_KEY_dht_enabled_kebab,
|
||||
TR_KEY_dht_enabled,
|
||||
TR_KEY_download_dir_kebab,
|
||||
TR_KEY_download_dir_free_space_kebab,
|
||||
TR_KEY_download_queue_enabled_kebab,
|
||||
TR_KEY_download_queue_size_kebab,
|
||||
TR_KEY_download_dir,
|
||||
TR_KEY_download_dir_free_space,
|
||||
TR_KEY_download_queue_enabled,
|
||||
TR_KEY_download_queue_size,
|
||||
TR_KEY_encryption,
|
||||
TR_KEY_idle_seeding_limit_kebab,
|
||||
TR_KEY_idle_seeding_limit_enabled_kebab,
|
||||
TR_KEY_idle_seeding_limit,
|
||||
TR_KEY_idle_seeding_limit_enabled,
|
||||
TR_KEY_incomplete_dir_kebab,
|
||||
TR_KEY_incomplete_dir_enabled_kebab,
|
||||
TR_KEY_incomplete_dir,
|
||||
TR_KEY_incomplete_dir_enabled,
|
||||
TR_KEY_lpd_enabled_kebab,
|
||||
TR_KEY_lpd_enabled,
|
||||
TR_KEY_peer_limit_global_kebab,
|
||||
TR_KEY_peer_limit_per_torrent_kebab,
|
||||
TR_KEY_peer_port_kebab,
|
||||
TR_KEY_peer_port_random_on_start_kebab,
|
||||
TR_KEY_peer_limit_global,
|
||||
TR_KEY_peer_limit_per_torrent,
|
||||
TR_KEY_peer_port,
|
||||
TR_KEY_peer_port_random_on_start,
|
||||
TR_KEY_pex_enabled_kebab,
|
||||
TR_KEY_pex_enabled,
|
||||
TR_KEY_port_forwarding_enabled_kebab,
|
||||
TR_KEY_port_forwarding_enabled,
|
||||
TR_KEY_preferred_transports,
|
||||
TR_KEY_queue_stalled_enabled_kebab,
|
||||
TR_KEY_queue_stalled_minutes_kebab,
|
||||
TR_KEY_queue_stalled_enabled,
|
||||
TR_KEY_queue_stalled_minutes,
|
||||
TR_KEY_rename_partial_files_kebab,
|
||||
TR_KEY_rename_partial_files,
|
||||
TR_KEY_reqq,
|
||||
TR_KEY_rpc_version_kebab,
|
||||
TR_KEY_rpc_version_minimum_kebab,
|
||||
TR_KEY_rpc_version_semver_kebab,
|
||||
TR_KEY_rpc_version,
|
||||
TR_KEY_rpc_version_minimum,
|
||||
TR_KEY_rpc_version_semver,
|
||||
TR_KEY_script_torrent_added_enabled_kebab,
|
||||
TR_KEY_script_torrent_added_filename_kebab,
|
||||
TR_KEY_script_torrent_done_enabled_kebab,
|
||||
TR_KEY_script_torrent_done_filename_kebab,
|
||||
TR_KEY_script_torrent_done_seeding_enabled_kebab,
|
||||
TR_KEY_script_torrent_done_seeding_filename_kebab,
|
||||
TR_KEY_script_torrent_added_enabled,
|
||||
TR_KEY_script_torrent_added_filename,
|
||||
TR_KEY_script_torrent_done_enabled,
|
||||
TR_KEY_script_torrent_done_filename,
|
||||
TR_KEY_script_torrent_done_seeding_enabled,
|
||||
TR_KEY_script_torrent_done_seeding_filename,
|
||||
TR_KEY_seed_queue_enabled_kebab,
|
||||
TR_KEY_seed_queue_size_kebab,
|
||||
TR_KEY_seed_ratio_limit_camel,
|
||||
TR_KEY_seed_ratio_limited_camel,
|
||||
TR_KEY_seed_queue_enabled,
|
||||
TR_KEY_seed_queue_size,
|
||||
TR_KEY_seedRatioLimit,
|
||||
TR_KEY_seedRatioLimited,
|
||||
TR_KEY_seed_ratio_limit,
|
||||
TR_KEY_seed_ratio_limited,
|
||||
TR_KEY_sequential_download,
|
||||
TR_KEY_session_id_kebab,
|
||||
TR_KEY_session_id,
|
||||
TR_KEY_speed_limit_down_kebab,
|
||||
TR_KEY_speed_limit_down_enabled_kebab,
|
||||
TR_KEY_speed_limit_up_kebab,
|
||||
TR_KEY_speed_limit_up_enabled_kebab,
|
||||
TR_KEY_speed_limit_down,
|
||||
TR_KEY_speed_limit_down_enabled,
|
||||
TR_KEY_speed_limit_up,
|
||||
TR_KEY_speed_limit_up_enabled,
|
||||
TR_KEY_start_added_torrents_kebab,
|
||||
TR_KEY_start_added_torrents,
|
||||
TR_KEY_tcp_enabled_kebab,
|
||||
TR_KEY_tcp_enabled,
|
||||
TR_KEY_trash_original_torrent_files_kebab,
|
||||
TR_KEY_trash_original_torrent_files,
|
||||
TR_KEY_units,
|
||||
TR_KEY_utp_enabled_kebab,
|
||||
TR_KEY_utp_enabled,
|
||||
TR_KEY_version,
|
||||
};
|
||||
@@ -708,7 +764,7 @@ TEST_F(RpcTest, torrentGet)
|
||||
auto request = tr_variant::Map{ 3U };
|
||||
|
||||
request.try_emplace(TR_KEY_jsonrpc, JsonRpc::Version);
|
||||
request.try_emplace(TR_KEY_method, "torrent-get"sv);
|
||||
request.try_emplace(TR_KEY_method, "torrent_get"sv);
|
||||
request.try_emplace(TR_KEY_id, 12345);
|
||||
|
||||
auto params = tr_variant::Map{ 1U };
|
||||
|
||||
564
utils/remote.cc
564
utils/remote.cc
File diff suppressed because it is too large
Load Diff
@@ -51,7 +51,7 @@ export class FileRow extends EventTarget {
|
||||
const files = this.fields.torrent.getFiles();
|
||||
for (const index of this.fields.indices) {
|
||||
const file = files[index];
|
||||
have += file.bytesCompleted;
|
||||
have += file.bytes_completed;
|
||||
size += file.length;
|
||||
wanted |= file.wanted;
|
||||
switch (file.priority.toString()) {
|
||||
|
||||
@@ -109,8 +109,8 @@ export class Inspector extends EventTarget {
|
||||
['hash', 'Hash:'],
|
||||
['privacy', 'Privacy:'],
|
||||
['origin', 'Origin:'],
|
||||
['dateAdded', 'Date added:'],
|
||||
['magnetLink', 'Magnet:'],
|
||||
['date_added', 'Date added:'],
|
||||
['magnet_link', 'Magnet:'],
|
||||
['comment', 'Comment:'],
|
||||
['labels', 'Labels:'],
|
||||
];
|
||||
@@ -541,7 +541,7 @@ export class Inspector extends EventTarget {
|
||||
}
|
||||
setTextContent(e.info.location, string);
|
||||
|
||||
// dateAdded
|
||||
// date_added
|
||||
if (torrents.length === 0) {
|
||||
string = none;
|
||||
} else {
|
||||
@@ -561,16 +561,16 @@ export class Inspector extends EventTarget {
|
||||
})
|
||||
: mixed;
|
||||
}
|
||||
setTextContent(e.info.dateAdded, string);
|
||||
setTextContent(e.info.date_added, string);
|
||||
|
||||
// magnetLink
|
||||
// magnet_link
|
||||
if (torrents.length === 0) {
|
||||
setTextContent(e.info.magnetLink, none);
|
||||
setTextContent(e.info.magnet_link, none);
|
||||
} else if (torrents.length > 1) {
|
||||
setTextContent(e.info.magnetLink, mixed);
|
||||
setTextContent(e.info.magnet_link, mixed);
|
||||
} else {
|
||||
const link = torrents[0].getMagnetLink();
|
||||
e.info.magnetLink.innerHTML = `<a class="inspector-info-magnet" href="${link}"><button></button></a>`;
|
||||
e.info.magnet_link.innerHTML = `<a class="inspector-info-magnet" href="${link}"><button></button></a>`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -605,30 +605,30 @@ export class Inspector extends EventTarget {
|
||||
|
||||
const cell_setters = [
|
||||
(peer, td) => {
|
||||
td.dataset.encrypted = peer.isEncrypted;
|
||||
td.dataset.encrypted = peer.is_encrypted;
|
||||
},
|
||||
(peer, td) =>
|
||||
setTextContent(
|
||||
td,
|
||||
peer.rateToPeer ? fmt.speedBps(peer.rateToPeer) : '',
|
||||
peer.rate_to_peer ? fmt.speedBps(peer.rate_to_peer) : '',
|
||||
),
|
||||
(peer, td) =>
|
||||
setTextContent(
|
||||
td,
|
||||
peer.rateToClient ? fmt.speedBps(peer.rateToClient) : '',
|
||||
peer.rate_to_client ? fmt.speedBps(peer.rate_to_client) : '',
|
||||
),
|
||||
(peer, td) => setTextContent(td, `${Math.floor(peer.progress * 100)}%`),
|
||||
(peer, td) => {
|
||||
setTextContent(td, peer.flagStr);
|
||||
td.setAttribute('title', Inspector._peerStatusTitle(peer.flagStr));
|
||||
setTextContent(td, peer.flag_str);
|
||||
td.setAttribute('title', Inspector._peerStatusTitle(peer.flag_str));
|
||||
},
|
||||
(peer, td) => {
|
||||
setTextContent(td, peer.address);
|
||||
td.setAttribute('title', peer.address);
|
||||
},
|
||||
(peer, td) => {
|
||||
setTextContent(td, peer.clientName);
|
||||
td.setAttribute('title', peer.clientName);
|
||||
setTextContent(td, peer.client_name);
|
||||
td.setAttribute('title', peer.client_name);
|
||||
},
|
||||
];
|
||||
|
||||
@@ -667,24 +667,24 @@ export class Inspector extends EventTarget {
|
||||
/// TRACKERS PAGE
|
||||
|
||||
static getAnnounceState(tracker) {
|
||||
switch (tracker.announceState) {
|
||||
switch (tracker.announce_state) {
|
||||
case Torrent._TrackerActive:
|
||||
return 'Announce in progress';
|
||||
case Torrent._TrackerWaiting: {
|
||||
const timeUntilAnnounce = Math.max(
|
||||
0,
|
||||
tracker.nextAnnounceTime - Date.now() / 1000,
|
||||
tracker.next_announce_time - Date.now() / 1000,
|
||||
);
|
||||
return `Next announce in ${Formatter.timeInterval(timeUntilAnnounce)}`;
|
||||
}
|
||||
case Torrent._TrackerQueued:
|
||||
return 'Announce is queued';
|
||||
case Torrent._TrackerInactive:
|
||||
return tracker.isBackup
|
||||
return tracker.is_backup
|
||||
? 'Tracker will be used as a backup'
|
||||
: 'Announce not scheduled';
|
||||
default:
|
||||
return `unknown announce state: ${tracker.announceState}`;
|
||||
return `unknown announce state: ${tracker.announce_state}`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -692,19 +692,25 @@ export class Inspector extends EventTarget {
|
||||
let lastAnnounceLabel = 'Last Announce';
|
||||
let lastAnnounce = ['N/A'];
|
||||
|
||||
if (tracker.hasAnnounced) {
|
||||
const lastAnnounceTime = Formatter.timestamp(tracker.lastAnnounceTime);
|
||||
if (tracker.lastAnnounceSucceeded) {
|
||||
if (tracker.has_announced) {
|
||||
const lastAnnounceTime = Formatter.timestamp(tracker.last_announce_time);
|
||||
if (tracker.last_announce_succeeded) {
|
||||
lastAnnounce = [
|
||||
lastAnnounceTime,
|
||||
' (got ',
|
||||
Formatter.countString('peer', 'peers', tracker.lastAnnouncePeerCount),
|
||||
Formatter.countString(
|
||||
'peer',
|
||||
'peers',
|
||||
tracker.last_announce_peer_count,
|
||||
),
|
||||
')',
|
||||
];
|
||||
} else {
|
||||
lastAnnounceLabel = 'Announce error';
|
||||
lastAnnounce = [
|
||||
tracker.lastAnnounceResult ? `${tracker.lastAnnounceResult} - ` : '',
|
||||
tracker.last_announce_result
|
||||
? `${tracker.last_announce_result} - `
|
||||
: '',
|
||||
lastAnnounceTime,
|
||||
];
|
||||
}
|
||||
@@ -719,15 +725,16 @@ export class Inspector extends EventTarget {
|
||||
let lastScrapeLabel = 'Last Scrape';
|
||||
let lastScrape = 'N/A';
|
||||
|
||||
if (tracker.hasScraped) {
|
||||
const lastScrapeTime = Formatter.timestamp(tracker.lastScrapeTime);
|
||||
if (tracker.lastScrapeSucceeded) {
|
||||
if (tracker.has_scraped) {
|
||||
const lastScrapeTime = Formatter.timestamp(tracker.last_scrape_time);
|
||||
if (tracker.last_scrape_succeeded) {
|
||||
lastScrape = lastScrapeTime;
|
||||
} else {
|
||||
lastScrapeLabel = 'Scrape error';
|
||||
lastScrape =
|
||||
(tracker.lastScrapeResult ? `${tracker.lastScrapeResult} - ` : '') +
|
||||
lastScrapeTime;
|
||||
(tracker.last_scrape_result
|
||||
? `${tracker.last_scrape_result} - `
|
||||
: '') + lastScrapeTime;
|
||||
}
|
||||
}
|
||||
return {
|
||||
@@ -795,7 +802,7 @@ export class Inspector extends EventTarget {
|
||||
element.classList.add('tier-seeders');
|
||||
setTextContent(
|
||||
element,
|
||||
`Seeders: ${tracker.seederCount > -1 ? tracker.seederCount : na}`,
|
||||
`Seeders: ${tracker.seeder_count > -1 ? tracker.seeder_count : na}`,
|
||||
);
|
||||
tier_div.append(element);
|
||||
|
||||
@@ -808,7 +815,9 @@ export class Inspector extends EventTarget {
|
||||
element.classList.add('tier-leechers');
|
||||
setTextContent(
|
||||
element,
|
||||
`Leechers: ${tracker.leecherCount > -1 ? tracker.leecherCount : na}`,
|
||||
`Leechers: ${
|
||||
tracker.leecher_count > -1 ? tracker.leecher_count : na
|
||||
}`,
|
||||
);
|
||||
tier_div.append(element);
|
||||
|
||||
@@ -825,7 +834,7 @@ export class Inspector extends EventTarget {
|
||||
setTextContent(
|
||||
element,
|
||||
`Downloads: ${
|
||||
tracker.downloadCount > -1 ? tracker.downloadCount : na
|
||||
tracker.download_count > -1 ? tracker.download_count : na
|
||||
}`,
|
||||
);
|
||||
tier_div.append(element);
|
||||
@@ -853,7 +862,7 @@ export class Inspector extends EventTarget {
|
||||
const { indices, wanted } = event_;
|
||||
this._changeFileCommand(
|
||||
indices,
|
||||
wanted ? 'files-wanted' : 'files-unwanted',
|
||||
wanted ? 'files_wanted' : 'files_unwanted',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -863,13 +872,13 @@ export class Inspector extends EventTarget {
|
||||
let command = null;
|
||||
switch (priority.toString()) {
|
||||
case '-1':
|
||||
command = 'priority-low';
|
||||
command = 'priority_low';
|
||||
break;
|
||||
case '1':
|
||||
command = 'priority-high';
|
||||
command = 'priority_high';
|
||||
break;
|
||||
default:
|
||||
command = 'priority-normal';
|
||||
command = 'priority_normal';
|
||||
}
|
||||
|
||||
this._changeFileCommand(indices, command);
|
||||
|
||||
@@ -79,9 +79,9 @@ export class OpenDialog extends EventTarget {
|
||||
const o = {
|
||||
id: 'webui',
|
||||
jsonrpc: RPC._JsonRpcVersion,
|
||||
method: 'torrent-add',
|
||||
method: 'torrent_add',
|
||||
params: {
|
||||
'download-dir': destination,
|
||||
download_dir: destination,
|
||||
metainfo: contents.slice(Math.max(0, index + key.length)),
|
||||
paused,
|
||||
},
|
||||
@@ -111,9 +111,9 @@ export class OpenDialog extends EventTarget {
|
||||
const o = {
|
||||
id: 'webui',
|
||||
jsonrpc: RPC._JsonRpcVersion,
|
||||
method: 'torrent-add',
|
||||
method: 'torrent_add',
|
||||
params: {
|
||||
'download-dir': destination,
|
||||
download_dir: destination,
|
||||
filename: url,
|
||||
paused,
|
||||
},
|
||||
@@ -188,7 +188,7 @@ export class OpenDialog extends EventTarget {
|
||||
input.type = 'text';
|
||||
input.id = 'add-dialog-folder-input';
|
||||
input.addEventListener('change', () => this._updateFreeSpaceInAddDialog());
|
||||
input.value = this.controller.session_properties['download-dir'];
|
||||
input.value = this.controller.session_properties.download_dir;
|
||||
workarea.append(input);
|
||||
elements.folder_input = input;
|
||||
|
||||
|
||||
@@ -63,9 +63,9 @@ export class PrefsDialog extends EventTarget {
|
||||
|
||||
const args = response.result ?? response.error?.data ?? {};
|
||||
const element = this.elements.network.port_status_label[ip_protocol];
|
||||
const is_open = args['port-is-open'] ?? false;
|
||||
const is_open = args.port_is_open ?? false;
|
||||
element.dataset.open = is_open;
|
||||
if ('port-is-open' in args) {
|
||||
if ('port_is_open' in args) {
|
||||
setTextContent(element, is_open ? 'Open' : 'Closed');
|
||||
} else {
|
||||
setTextContent(element, 'Error');
|
||||
@@ -108,7 +108,7 @@ export class PrefsDialog extends EventTarget {
|
||||
}
|
||||
|
||||
_onMaybePortChanged(key) {
|
||||
if (key === 'peer-port' || key === 'port-forwarding-enabled') {
|
||||
if (key === 'peer_port' || key === 'port_forwarding_enabled') {
|
||||
this._checkPort();
|
||||
}
|
||||
}
|
||||
@@ -137,7 +137,7 @@ export class PrefsDialog extends EventTarget {
|
||||
for (const element of this.elements.root.querySelectorAll(
|
||||
`[data-key="${key}"]`,
|
||||
)) {
|
||||
if (key === 'blocklist-size') {
|
||||
if (key === 'blocklist_size') {
|
||||
const n = Formatter.number(value);
|
||||
element.innerHTML = `Blocklist has <span class="blocklist-size-number">${n}</span> rules`;
|
||||
setTextContent(this.elements.peers.blocklist_update_button, 'Update');
|
||||
@@ -177,10 +177,6 @@ export class PrefsDialog extends EventTarget {
|
||||
}
|
||||
}
|
||||
|
||||
shouldAddedTorrentsStart() {
|
||||
return this.data.elements.root.find('#start-added-torrents')[0].checked;
|
||||
}
|
||||
|
||||
static _createCheckAndLabel(id, text) {
|
||||
const root = document.createElement('div');
|
||||
root.id = id;
|
||||
@@ -273,7 +269,7 @@ export class PrefsDialog extends EventTarget {
|
||||
let input = document.createElement('input');
|
||||
input.type = 'text';
|
||||
input.id = makeUUID();
|
||||
input.dataset.key = 'download-dir';
|
||||
input.dataset.key = 'download_dir';
|
||||
label.setAttribute('for', input.id);
|
||||
root.append(input);
|
||||
const download_dir = input;
|
||||
@@ -284,20 +280,20 @@ export class PrefsDialog extends EventTarget {
|
||||
);
|
||||
cal.check.title =
|
||||
'Separate folder to temporarily store downloads until they are complete.';
|
||||
cal.check.dataset.key = 'incomplete-dir-enabled';
|
||||
cal.check.dataset.key = 'incomplete_dir_enabled';
|
||||
cal.label.title = cal.check.title;
|
||||
root.append(cal.root);
|
||||
const incomplete_dir_check = cal.check;
|
||||
|
||||
input = document.createElement('input');
|
||||
input.type = 'text';
|
||||
input.dataset.key = 'incomplete-dir';
|
||||
input.dataset.key = 'incomplete_dir';
|
||||
root.append(input);
|
||||
PrefsDialog._enableIfChecked(input, cal.check);
|
||||
const incomplete_dir_input = input;
|
||||
|
||||
cal = PrefsDialog._createCheckAndLabel('autostart-div', 'Start when added');
|
||||
cal.check.dataset.key = 'start-added-torrents';
|
||||
cal.check.dataset.key = 'start_added_torrents';
|
||||
root.append(cal.root);
|
||||
const autostart_check = cal.check;
|
||||
|
||||
@@ -305,7 +301,7 @@ export class PrefsDialog extends EventTarget {
|
||||
'suffix-div',
|
||||
`Append "part" to incomplete files' names`,
|
||||
);
|
||||
cal.check.dataset.key = 'rename-partial-files';
|
||||
cal.check.dataset.key = 'rename_partial_files';
|
||||
root.append(cal.root);
|
||||
const suffix_check = cal.check;
|
||||
|
||||
@@ -313,13 +309,13 @@ export class PrefsDialog extends EventTarget {
|
||||
'download-queue-div',
|
||||
'Download queue size:',
|
||||
);
|
||||
cal.check.dataset.key = 'download-queue-enabled';
|
||||
cal.check.dataset.key = 'download_queue_enabled';
|
||||
root.append(cal.root);
|
||||
const download_queue_check = cal.check;
|
||||
|
||||
input = document.createElement('input');
|
||||
input.type = 'number';
|
||||
input.dataset.key = 'download-queue-size';
|
||||
input.dataset.key = 'download_queue_size';
|
||||
root.append(input);
|
||||
PrefsDialog._enableIfChecked(input, cal.check);
|
||||
const download_queue_input = input;
|
||||
@@ -333,7 +329,7 @@ export class PrefsDialog extends EventTarget {
|
||||
'stop-ratio-div',
|
||||
'Stop seeding at ratio:',
|
||||
);
|
||||
cal.check.dataset.key = 'seedRatioLimited';
|
||||
cal.check.dataset.key = 'seed_ratio_limited';
|
||||
root.append(cal.root);
|
||||
const stop_ratio_check = cal.check;
|
||||
|
||||
@@ -341,7 +337,7 @@ export class PrefsDialog extends EventTarget {
|
||||
input.type = 'number';
|
||||
input.min = '0.1';
|
||||
input.step = 'any';
|
||||
input.dataset.key = 'seedRatioLimit';
|
||||
input.dataset.key = 'seed_ratio_limit';
|
||||
root.append(input);
|
||||
PrefsDialog._enableIfChecked(input, cal.check);
|
||||
const stop_ratio_input = input;
|
||||
@@ -350,7 +346,7 @@ export class PrefsDialog extends EventTarget {
|
||||
'stop-idle-div',
|
||||
'Stop seeding if idle for N mins:',
|
||||
);
|
||||
cal.check.dataset.key = 'idle-seeding-limit-enabled';
|
||||
cal.check.dataset.key = 'idle_seeding_limit_enabled';
|
||||
root.append(cal.root);
|
||||
const stop_idle_check = cal.check;
|
||||
|
||||
@@ -358,7 +354,7 @@ export class PrefsDialog extends EventTarget {
|
||||
input.type = 'number';
|
||||
input.min = '0.1';
|
||||
input.step = 'any';
|
||||
input.dataset.key = 'idle-seeding-limit';
|
||||
input.dataset.key = 'idle_seeding_limit';
|
||||
root.append(input);
|
||||
PrefsDialog._enableIfChecked(input, cal.check);
|
||||
const stop_idle_input = input;
|
||||
@@ -404,13 +400,13 @@ export class PrefsDialog extends EventTarget {
|
||||
'upload-speed-div',
|
||||
'Upload (kB/s):',
|
||||
);
|
||||
cal.check.dataset.key = 'speed-limit-up-enabled';
|
||||
cal.check.dataset.key = 'speed_limit_up_enabled';
|
||||
root.append(cal.root);
|
||||
const upload_speed_check = cal.check;
|
||||
|
||||
let input = document.createElement('input');
|
||||
input.type = 'number';
|
||||
input.dataset.key = 'speed-limit-up';
|
||||
input.dataset.key = 'speed_limit_up';
|
||||
root.append(input);
|
||||
PrefsDialog._enableIfChecked(input, cal.check);
|
||||
const upload_speed_input = input;
|
||||
@@ -419,13 +415,13 @@ export class PrefsDialog extends EventTarget {
|
||||
'download-speed-div',
|
||||
'Download (kB/s):',
|
||||
);
|
||||
cal.check.dataset.key = 'speed-limit-down-enabled';
|
||||
cal.check.dataset.key = 'speed_limit_down_enabled';
|
||||
root.append(cal.root);
|
||||
const download_speed_check = cal.check;
|
||||
|
||||
input = document.createElement('input');
|
||||
input.type = 'number';
|
||||
input.dataset.key = 'speed-limit-down';
|
||||
input.dataset.key = 'speed_limit_down';
|
||||
root.append(input);
|
||||
PrefsDialog._enableIfChecked(input, cal.check);
|
||||
const download_speed_input = input;
|
||||
@@ -447,7 +443,7 @@ export class PrefsDialog extends EventTarget {
|
||||
|
||||
input = document.createElement('input');
|
||||
input.type = 'number';
|
||||
input.dataset.key = 'alt-speed-up';
|
||||
input.dataset.key = 'alt_speed_up';
|
||||
input.id = makeUUID();
|
||||
label.setAttribute('for', input.id);
|
||||
root.append(input);
|
||||
@@ -459,14 +455,14 @@ export class PrefsDialog extends EventTarget {
|
||||
|
||||
input = document.createElement('input');
|
||||
input.type = 'number';
|
||||
input.dataset.key = 'alt-speed-down';
|
||||
input.dataset.key = 'alt_speed_down';
|
||||
input.id = makeUUID();
|
||||
label.setAttribute('for', input.id);
|
||||
root.append(input);
|
||||
const alt_download_speed_input = input;
|
||||
|
||||
cal = PrefsDialog._createCheckAndLabel('alt-times-div', 'Scheduled times');
|
||||
cal.check.dataset.key = 'alt-speed-time-enabled';
|
||||
cal.check.dataset.key = 'alt_speed_time_enabled';
|
||||
root.append(cal.root);
|
||||
const alt_times_check = cal.check;
|
||||
|
||||
@@ -477,7 +473,7 @@ export class PrefsDialog extends EventTarget {
|
||||
|
||||
let select = document.createElement('select');
|
||||
select.id = makeUUID();
|
||||
select.dataset.key = 'alt-speed-time-begin';
|
||||
select.dataset.key = 'alt_speed_time_begin';
|
||||
PrefsDialog._initTimeDropDown(select);
|
||||
label.setAttribute('for', select.id);
|
||||
root.append(select);
|
||||
@@ -491,7 +487,7 @@ export class PrefsDialog extends EventTarget {
|
||||
|
||||
select = document.createElement('select');
|
||||
select.id = makeUUID();
|
||||
select.dataset.key = 'alt-speed-time-end';
|
||||
select.dataset.key = 'alt_speed_time_end';
|
||||
PrefsDialog._initTimeDropDown(select);
|
||||
label.setAttribute('for', select.id);
|
||||
root.append(select);
|
||||
@@ -505,7 +501,7 @@ export class PrefsDialog extends EventTarget {
|
||||
|
||||
select = document.createElement('select');
|
||||
select.id = makeUUID();
|
||||
select.dataset.key = 'alt-speed-time-day';
|
||||
select.dataset.key = 'alt_speed_time_day';
|
||||
PrefsDialog._initDayDropDown(select);
|
||||
label.setAttribute('for', select.id);
|
||||
root.append(select);
|
||||
@@ -542,7 +538,7 @@ export class PrefsDialog extends EventTarget {
|
||||
|
||||
let input = document.createElement('input');
|
||||
input.type = 'number';
|
||||
input.dataset.key = 'peer-limit-per-torrent';
|
||||
input.dataset.key = 'peer_limit_per_torrent';
|
||||
input.id = makeUUID();
|
||||
label.setAttribute('for', input.id);
|
||||
root.append(input);
|
||||
@@ -554,7 +550,7 @@ export class PrefsDialog extends EventTarget {
|
||||
|
||||
input = document.createElement('input');
|
||||
input.type = 'number';
|
||||
input.dataset.key = 'peer-limit-global';
|
||||
input.dataset.key = 'peer_limit_global';
|
||||
input.id = makeUUID();
|
||||
label.setAttribute('for', input.id);
|
||||
root.append(input);
|
||||
@@ -584,7 +580,7 @@ export class PrefsDialog extends EventTarget {
|
||||
);
|
||||
cal.check.title =
|
||||
"PEX is a tool for exchanging peer lists with the peers you're connected to.";
|
||||
cal.check.dataset.key = 'pex-enabled';
|
||||
cal.check.dataset.key = 'pex_enabled';
|
||||
cal.label.title = cal.check.title;
|
||||
root.append(cal.root);
|
||||
const pex_check = cal.check;
|
||||
@@ -594,7 +590,7 @@ export class PrefsDialog extends EventTarget {
|
||||
'Use DHT to find more peers',
|
||||
);
|
||||
cal.check.title = 'DHT is a tool for finding peers without a tracker.';
|
||||
cal.check.dataset.key = 'dht-enabled';
|
||||
cal.check.dataset.key = 'dht_enabled';
|
||||
cal.label.title = cal.check.title;
|
||||
root.append(cal.root);
|
||||
const dht_check = cal.check;
|
||||
@@ -604,7 +600,7 @@ export class PrefsDialog extends EventTarget {
|
||||
'Use LPD to find more peers',
|
||||
);
|
||||
cal.check.title = 'LPD is a tool for finding peers on your local network.';
|
||||
cal.check.dataset.key = 'lpd-enabled';
|
||||
cal.check.dataset.key = 'lpd_enabled';
|
||||
cal.label.title = cal.check.title;
|
||||
root.append(cal.root);
|
||||
const lpd_check = cal.check;
|
||||
@@ -618,21 +614,21 @@ export class PrefsDialog extends EventTarget {
|
||||
'blocklist-enabled-div',
|
||||
'Enable blocklist:',
|
||||
);
|
||||
cal.check.dataset.key = 'blocklist-enabled';
|
||||
cal.check.dataset.key = 'blocklist_enabled';
|
||||
root.append(cal.root);
|
||||
const blocklist_enabled_check = cal.check;
|
||||
|
||||
input = document.createElement('input');
|
||||
input.type = 'url';
|
||||
input.value = 'http://www.example.com/blocklist';
|
||||
input.dataset.key = 'blocklist-url';
|
||||
input.dataset.key = 'blocklist_url';
|
||||
root.append(input);
|
||||
PrefsDialog._enableIfChecked(input, cal.check);
|
||||
const blocklist_url_input = input;
|
||||
|
||||
label = document.createElement('label');
|
||||
label.textContent = 'Blocklist has {n} rules';
|
||||
label.dataset.key = 'blocklist-size';
|
||||
label.dataset.key = 'blocklist_size';
|
||||
label.classList.add('blocklist-size-label');
|
||||
PrefsDialog._enableIfChecked(label, cal.check);
|
||||
root.append(label);
|
||||
@@ -673,7 +669,7 @@ export class PrefsDialog extends EventTarget {
|
||||
|
||||
const input = document.createElement('input');
|
||||
input.type = 'number';
|
||||
input.dataset.key = 'peer-port';
|
||||
input.dataset.key = 'peer_port';
|
||||
input.id = makeUUID();
|
||||
label.setAttribute('for', input.id);
|
||||
root.append(input);
|
||||
@@ -702,7 +698,7 @@ export class PrefsDialog extends EventTarget {
|
||||
'randomize-port',
|
||||
'Randomize port on launch',
|
||||
);
|
||||
cal.check.dataset.key = 'peer-port-random-on-start';
|
||||
cal.check.dataset.key = 'peer_port_random_on_start';
|
||||
root.append(cal.root);
|
||||
const random_port_check = cal.check;
|
||||
|
||||
@@ -710,7 +706,7 @@ export class PrefsDialog extends EventTarget {
|
||||
'port-forwarding',
|
||||
'Use port forwarding from my router',
|
||||
);
|
||||
cal.check.dataset.key = 'port-forwarding-enabled';
|
||||
cal.check.dataset.key = 'port_forwarding_enabled';
|
||||
root.append(cal.root);
|
||||
const port_forwarding_check = cal.check;
|
||||
|
||||
@@ -723,7 +719,7 @@ export class PrefsDialog extends EventTarget {
|
||||
'utp-enabled',
|
||||
'Enable uTP for peer communication',
|
||||
);
|
||||
cal.check.dataset.key = 'utp-enabled';
|
||||
cal.check.dataset.key = 'utp_enabled';
|
||||
root.append(cal.root);
|
||||
const utp_check = cal.check;
|
||||
|
||||
@@ -746,7 +742,7 @@ export class PrefsDialog extends EventTarget {
|
||||
}
|
||||
|
||||
const textarea = document.createElement('textarea');
|
||||
textarea.dataset.key = 'default-trackers';
|
||||
textarea.dataset.key = 'default_trackers';
|
||||
textarea.id = 'default-trackers';
|
||||
root.append(textarea);
|
||||
const default_trackers_textarea = textarea;
|
||||
|
||||
@@ -6,19 +6,19 @@ import { AlertDialog } from './alert-dialog.js';
|
||||
|
||||
export const RPC = {
|
||||
_DaemonVersion: 'version',
|
||||
_DownSpeedLimit: 'speed-limit-down',
|
||||
_DownSpeedLimited: 'speed-limit-down-enabled',
|
||||
_DownSpeedLimit: 'speed_limit_down',
|
||||
_DownSpeedLimited: 'speed_limit_down_enabled',
|
||||
_JsonRpcVersion: '2.0',
|
||||
_QueueMoveBottom: 'queue-move-bottom',
|
||||
_QueueMoveDown: 'queue-move-down',
|
||||
_QueueMoveTop: 'queue-move-top',
|
||||
_QueueMoveUp: 'queue-move-up',
|
||||
_QueueMoveBottom: 'queue_move_bottom',
|
||||
_QueueMoveDown: 'queue_move_down',
|
||||
_QueueMoveTop: 'queue_move_top',
|
||||
_QueueMoveUp: 'queue_move_up',
|
||||
_Root: '../rpc',
|
||||
_TurtleDownSpeedLimit: 'alt-speed-down',
|
||||
_TurtleState: 'alt-speed-enabled',
|
||||
_TurtleUpSpeedLimit: 'alt-speed-up',
|
||||
_UpSpeedLimit: 'speed-limit-up',
|
||||
_UpSpeedLimited: 'speed-limit-up-enabled',
|
||||
_TurtleDownSpeedLimit: 'alt_speed_down',
|
||||
_TurtleState: 'alt_speed_enabled',
|
||||
_TurtleUpSpeedLimit: 'alt_speed_up',
|
||||
_UpSpeedLimit: 'speed_limit_up',
|
||||
_UpSpeedLimited: 'speed_limit_up_enabled',
|
||||
};
|
||||
|
||||
export class Remote {
|
||||
@@ -93,7 +93,7 @@ export class Remote {
|
||||
const o = {
|
||||
id: 'webui',
|
||||
jsonrpc: RPC._JsonRpcVersion,
|
||||
method: 'session-get',
|
||||
method: 'session_get',
|
||||
};
|
||||
this.sendRequest(o, callback, context);
|
||||
}
|
||||
@@ -102,7 +102,7 @@ export class Remote {
|
||||
const o = {
|
||||
id: 'webui',
|
||||
jsonrpc: RPC._JsonRpcVersion,
|
||||
method: 'port-test',
|
||||
method: 'port_test',
|
||||
params: {
|
||||
ip_protocol,
|
||||
},
|
||||
@@ -114,7 +114,7 @@ export class Remote {
|
||||
const o = {
|
||||
id: 'webui',
|
||||
jsonrpc: RPC._JsonRpcVersion,
|
||||
method: 'torrent-rename-path',
|
||||
method: 'torrent_rename_path',
|
||||
params: {
|
||||
ids: torrentIds,
|
||||
name: newname,
|
||||
@@ -133,7 +133,7 @@ export class Remote {
|
||||
{
|
||||
id: 'webui',
|
||||
jsonrpc: RPC._JsonRpcVersion,
|
||||
method: 'torrent-set',
|
||||
method: 'torrent_set',
|
||||
params,
|
||||
},
|
||||
callback,
|
||||
@@ -144,7 +144,7 @@ export class Remote {
|
||||
const o = {
|
||||
id: 'webui',
|
||||
jsonrpc: RPC._JsonRpcVersion,
|
||||
method: 'session-stats',
|
||||
method: 'session_stats',
|
||||
};
|
||||
this.sendRequest(o, callback, context);
|
||||
}
|
||||
@@ -153,7 +153,7 @@ export class Remote {
|
||||
const o = {
|
||||
id: 'webui',
|
||||
jsonrpc: RPC._JsonRpcVersion,
|
||||
method: 'torrent-get',
|
||||
method: 'torrent_get',
|
||||
params: {
|
||||
fields,
|
||||
format: 'table',
|
||||
@@ -172,11 +172,11 @@ export class Remote {
|
||||
const o = {
|
||||
id: 'webui',
|
||||
jsonrpc: RPC._JsonRpcVersion,
|
||||
method: 'free-space',
|
||||
method: 'free_space',
|
||||
params: { path: dir },
|
||||
};
|
||||
this.sendRequest(o, (response) => {
|
||||
const { path, 'size-bytes': size_bytes } = response.result;
|
||||
const { path, size_bytes } = response.result;
|
||||
callback.call(context, path, size_bytes);
|
||||
});
|
||||
}
|
||||
@@ -189,7 +189,7 @@ export class Remote {
|
||||
this.sendRequest(
|
||||
{
|
||||
jsonrpc: RPC._JsonRpcVersion,
|
||||
method: 'torrent-set',
|
||||
method: 'torrent_set',
|
||||
params,
|
||||
},
|
||||
() => {
|
||||
@@ -215,12 +215,12 @@ export class Remote {
|
||||
}
|
||||
|
||||
startTorrents(torrent_ids, noqueue, callback, context) {
|
||||
const name = noqueue ? 'torrent-start-now' : 'torrent-start';
|
||||
const name = noqueue ? 'torrent_start_now' : 'torrent_start';
|
||||
this.sendTorrentActionRequests(name, torrent_ids, callback, context);
|
||||
}
|
||||
stopTorrents(torrent_ids, callback, context) {
|
||||
this.sendTorrentActionRequests(
|
||||
'torrent-stop',
|
||||
'torrent_stop',
|
||||
torrent_ids,
|
||||
callback,
|
||||
context,
|
||||
@@ -229,7 +229,7 @@ export class Remote {
|
||||
|
||||
moveTorrents(torrent_ids, new_location, callback, context) {
|
||||
this.sendTorrentSetRequests(
|
||||
'torrent-set-location',
|
||||
'torrent_set_location',
|
||||
torrent_ids,
|
||||
{
|
||||
location: new_location,
|
||||
@@ -243,9 +243,9 @@ export class Remote {
|
||||
removeTorrents(torrents, trash) {
|
||||
const o = {
|
||||
jsonrpc: RPC._JsonRpcVersion,
|
||||
method: 'torrent-remove',
|
||||
method: 'torrent_remove',
|
||||
params: {
|
||||
'delete-local-data': trash,
|
||||
delete_local_data: trash,
|
||||
ids: [],
|
||||
},
|
||||
};
|
||||
@@ -261,7 +261,7 @@ export class Remote {
|
||||
}
|
||||
verifyTorrents(torrent_ids, callback, context) {
|
||||
this.sendTorrentActionRequests(
|
||||
'torrent-verify',
|
||||
'torrent_verify',
|
||||
torrent_ids,
|
||||
callback,
|
||||
context,
|
||||
@@ -269,7 +269,7 @@ export class Remote {
|
||||
}
|
||||
reannounceTorrents(torrent_ids, callback, context) {
|
||||
this.sendTorrentActionRequests(
|
||||
'torrent-reannounce',
|
||||
'torrent_reannounce',
|
||||
torrent_ids,
|
||||
callback,
|
||||
context,
|
||||
@@ -281,7 +281,7 @@ export class Remote {
|
||||
}
|
||||
const o = {
|
||||
jsonrpc: RPC._JsonRpcVersion,
|
||||
method: 'torrent-add',
|
||||
method: 'torrent_add',
|
||||
params: {
|
||||
filename: url,
|
||||
paused: options.paused,
|
||||
@@ -294,7 +294,7 @@ export class Remote {
|
||||
savePrefs(params) {
|
||||
const o = {
|
||||
jsonrpc: RPC._JsonRpcVersion,
|
||||
method: 'session-set',
|
||||
method: 'session_set',
|
||||
params,
|
||||
};
|
||||
this.sendRequest(o, () => {
|
||||
@@ -304,7 +304,7 @@ export class Remote {
|
||||
updateBlocklist() {
|
||||
const o = {
|
||||
jsonrpc: RPC._JsonRpcVersion,
|
||||
method: 'blocklist-update',
|
||||
method: 'blocklist_update',
|
||||
};
|
||||
this.sendRequest(o, () => {
|
||||
this._controller.loadDaemonPrefs();
|
||||
|
||||
@@ -49,22 +49,25 @@ export class StatisticsDialog extends EventTarget {
|
||||
console.log(stats);
|
||||
const fmt = Formatter;
|
||||
|
||||
let s = stats['current-stats'];
|
||||
let ratio = Utils.ratio(s.uploadedBytes, s.downloadedBytes);
|
||||
setTextContent(this.elements.session.up, fmt.size(s.uploadedBytes));
|
||||
setTextContent(this.elements.session.down, fmt.size(s.downloadedBytes));
|
||||
let s = stats.current_stats;
|
||||
let ratio = Utils.ratio(s.uploaded_bytes, s.downloaded_bytes);
|
||||
setTextContent(this.elements.session.up, fmt.size(s.uploaded_bytes));
|
||||
setTextContent(this.elements.session.down, fmt.size(s.downloaded_bytes));
|
||||
this.elements.session.ratio.innerHTML = fmt.ratioString(ratio);
|
||||
setTextContent(
|
||||
this.elements.session.time,
|
||||
fmt.timeInterval(s.secondsActive),
|
||||
fmt.timeInterval(s.seconds_active),
|
||||
);
|
||||
|
||||
s = stats['cumulative-stats'];
|
||||
ratio = Utils.ratio(s.uploadedBytes, s.downloadedBytes);
|
||||
setTextContent(this.elements.total.up, fmt.size(s.uploadedBytes));
|
||||
setTextContent(this.elements.total.down, fmt.size(s.downloadedBytes));
|
||||
s = stats.cumulative_stats;
|
||||
ratio = Utils.ratio(s.uploaded_bytes, s.downloaded_bytes);
|
||||
setTextContent(this.elements.total.up, fmt.size(s.uploaded_bytes));
|
||||
setTextContent(this.elements.total.down, fmt.size(s.downloaded_bytes));
|
||||
this.elements.total.ratio.innerHTML = fmt.ratioString(ratio);
|
||||
setTextContent(this.elements.total.time, fmt.timeInterval(s.secondsActive));
|
||||
setTextContent(
|
||||
this.elements.total.time,
|
||||
fmt.timeInterval(s.seconds_active),
|
||||
);
|
||||
}
|
||||
|
||||
static _create() {
|
||||
|
||||
@@ -51,7 +51,7 @@ export class Torrent extends EventTarget {
|
||||
updateFiles(files) {
|
||||
let changed = false;
|
||||
const myfiles = this.fields.files || [];
|
||||
const keys = ['length', 'name', 'bytesCompleted', 'wanted', 'priority'];
|
||||
const keys = ['length', 'name', 'bytes_completed', 'wanted', 'priority'];
|
||||
|
||||
for (const [index, f] of files.entries()) {
|
||||
const myfile = myfiles[index] || {};
|
||||
@@ -76,10 +76,10 @@ export class Torrent extends EventTarget {
|
||||
for (const [key, value] of Object.entries(data)) {
|
||||
switch (key) {
|
||||
case 'files':
|
||||
case 'fileStats': // merge files and fileStats together
|
||||
case 'file_stats': // merge files and file_stats together
|
||||
changed |= this.updateFiles(value);
|
||||
break;
|
||||
case 'trackerStats': // 'trackerStats' is a superset of 'trackers'...
|
||||
case 'tracker_stats': // 'tracker_stats' is a superset of 'trackers'...
|
||||
changed |= this.setField(this.fields, 'trackers', value);
|
||||
break;
|
||||
case 'trackers': // ...so only save 'trackers' if we don't have it already
|
||||
@@ -115,34 +115,34 @@ export class Torrent extends EventTarget {
|
||||
return this.fields.creator;
|
||||
}
|
||||
getDateAdded() {
|
||||
return this.fields.addedDate;
|
||||
return this.fields.added_date;
|
||||
}
|
||||
getDateCreated() {
|
||||
return this.fields.dateCreated;
|
||||
return this.fields.date_created;
|
||||
}
|
||||
getDesiredAvailable() {
|
||||
return this.fields.desiredAvailable;
|
||||
return this.fields.desired_available;
|
||||
}
|
||||
getDownloadDir() {
|
||||
return this.fields.downloadDir;
|
||||
return this.fields.download_dir;
|
||||
}
|
||||
getDownloadSpeed() {
|
||||
return this.fields.rateDownload;
|
||||
return this.fields.rate_download;
|
||||
}
|
||||
getDownloadedEver() {
|
||||
return this.fields.downloadedEver;
|
||||
return this.fields.downloaded_ever;
|
||||
}
|
||||
getError() {
|
||||
return this.fields.error;
|
||||
}
|
||||
getErrorString() {
|
||||
return this.fields.errorString;
|
||||
return this.fields.error_string;
|
||||
}
|
||||
getETA() {
|
||||
return this.fields.eta;
|
||||
}
|
||||
getFailedEver() {
|
||||
return this.fields.corruptEver;
|
||||
return this.fields.corrupt_ever;
|
||||
}
|
||||
getFiles() {
|
||||
return this.fields.files || [];
|
||||
@@ -151,19 +151,19 @@ export class Torrent extends EventTarget {
|
||||
return this.fields.files[index];
|
||||
}
|
||||
getFileCount() {
|
||||
return this.fields['file-count'];
|
||||
return this.fields.file_count;
|
||||
}
|
||||
getHashString() {
|
||||
return this.fields.hashString;
|
||||
return this.fields.hash_string;
|
||||
}
|
||||
getHave() {
|
||||
return this.getHaveValid() + this.getHaveUnchecked();
|
||||
}
|
||||
getHaveUnchecked() {
|
||||
return this.fields.haveUnchecked;
|
||||
return this.fields.have_unchecked;
|
||||
}
|
||||
getHaveValid() {
|
||||
return this.fields.haveValid;
|
||||
return this.fields.have_valid;
|
||||
}
|
||||
getId() {
|
||||
return this.fields.id;
|
||||
@@ -172,16 +172,16 @@ export class Torrent extends EventTarget {
|
||||
return this.fields.labels.toSorted();
|
||||
}
|
||||
getLastActivity() {
|
||||
return this.fields.activityDate;
|
||||
return this.fields.activity_date;
|
||||
}
|
||||
getLeftUntilDone() {
|
||||
return this.fields.leftUntilDone;
|
||||
return this.fields.left_until_done;
|
||||
}
|
||||
getMagnetLink() {
|
||||
return this.fields.magnetLink;
|
||||
return this.fields.magnet_link;
|
||||
}
|
||||
getMetadataPercentComplete() {
|
||||
return this.fields.metadataPercentComplete;
|
||||
return this.fields.metadata_percent_complete;
|
||||
}
|
||||
getName() {
|
||||
return this.fields.name || 'Unknown';
|
||||
@@ -190,72 +190,72 @@ export class Torrent extends EventTarget {
|
||||
return this.fields.peers || [];
|
||||
}
|
||||
getPeersConnected() {
|
||||
return this.fields.peersConnected;
|
||||
return this.fields.peers_connected;
|
||||
}
|
||||
getPeersGettingFromUs() {
|
||||
return this.fields.peersGettingFromUs;
|
||||
return this.fields.peers_getting_from_us;
|
||||
}
|
||||
getPeersSendingToUs() {
|
||||
return this.fields.peersSendingToUs;
|
||||
return this.fields.peers_sending_to_us;
|
||||
}
|
||||
getPieceCount() {
|
||||
return this.fields.pieceCount;
|
||||
return this.fields.piece_count;
|
||||
}
|
||||
getPieceSize() {
|
||||
return this.fields.pieceSize;
|
||||
return this.fields.piece_size;
|
||||
}
|
||||
getPrimaryMimeType() {
|
||||
return this.fields['primary-mime-type'] || 'application/octet-stream';
|
||||
return this.fields.primary_mime_type || 'application/octet-stream';
|
||||
}
|
||||
getPrivateFlag() {
|
||||
return this.fields.isPrivate;
|
||||
return this.fields.is_private;
|
||||
}
|
||||
getQueuePosition() {
|
||||
return this.fields.queuePosition;
|
||||
return this.fields.queue_position;
|
||||
}
|
||||
getRecheckProgress() {
|
||||
return this.fields.recheckProgress;
|
||||
return this.fields.recheck_progress;
|
||||
}
|
||||
getSeedRatioLimit() {
|
||||
return this.fields.seedRatioLimit;
|
||||
return this.fields.seed_ratio_limit;
|
||||
}
|
||||
getSeedRatioMode() {
|
||||
return this.fields.seedRatioMode;
|
||||
return this.fields.seed_ratio_mode;
|
||||
}
|
||||
getSizeWhenDone() {
|
||||
return this.fields.sizeWhenDone;
|
||||
return this.fields.size_when_done;
|
||||
}
|
||||
getStartDate() {
|
||||
return this.fields.startDate;
|
||||
return this.fields.start_date;
|
||||
}
|
||||
getStatus() {
|
||||
return this.fields.status;
|
||||
}
|
||||
getTotalSize() {
|
||||
return this.fields.totalSize;
|
||||
return this.fields.total_size;
|
||||
}
|
||||
getTrackers() {
|
||||
return this.fields.trackers || [];
|
||||
}
|
||||
getUploadSpeed() {
|
||||
return this.fields.rateUpload;
|
||||
return this.fields.rate_upload;
|
||||
}
|
||||
getUploadRatio() {
|
||||
return this.fields.uploadRatio;
|
||||
return this.fields.upload_ratio;
|
||||
}
|
||||
getUploadedEver() {
|
||||
return this.fields.uploadedEver;
|
||||
return this.fields.uploaded_ever;
|
||||
}
|
||||
getWebseedsSendingToUs() {
|
||||
return this.fields.webseedsSendingToUs;
|
||||
return this.fields.webseeds_sending_to_us;
|
||||
}
|
||||
isFinished() {
|
||||
return this.fields.isFinished;
|
||||
return this.fields.is_finished;
|
||||
}
|
||||
|
||||
// derived accessors
|
||||
hasExtraInfo() {
|
||||
return 'hashString' in this.fields;
|
||||
return 'hash_string' in this.fields;
|
||||
}
|
||||
isSeeding() {
|
||||
return this.getStatus() === Torrent._StatusSeed;
|
||||
@@ -288,7 +288,7 @@ export class Torrent extends EventTarget {
|
||||
return Formatter.percentString(100 * this.getPercentDone(), 1);
|
||||
}
|
||||
getPercentDone() {
|
||||
return this.fields.percentDone;
|
||||
return this.fields.percent_done;
|
||||
}
|
||||
getStateString() {
|
||||
switch (this.getStatus()) {
|
||||
@@ -569,7 +569,7 @@ Torrent._StatusDownload = 4;
|
||||
Torrent._StatusSeedWait = 5;
|
||||
Torrent._StatusSeed = 6;
|
||||
|
||||
// Torrent.fields.seedRatioMode
|
||||
// Torrent.fields.seed_ratio_mode
|
||||
Torrent._RatioUseGlobal = 0;
|
||||
Torrent._RatioUseLocal = 1;
|
||||
Torrent._RatioUnlimited = 2;
|
||||
@@ -580,7 +580,7 @@ Torrent._ErrTrackerWarning = 1;
|
||||
Torrent._ErrTrackerError = 2;
|
||||
Torrent._ErrLocalError = 3;
|
||||
|
||||
// TrackerStats' announceState
|
||||
// tracker_stats' announceState
|
||||
Torrent._TrackerInactive = 0;
|
||||
Torrent._TrackerWaiting = 1;
|
||||
Torrent._TrackerQueued = 2;
|
||||
@@ -592,65 +592,65 @@ Torrent.Fields = {};
|
||||
// either on startup or when a magnet finishes downloading its metadata
|
||||
// finishes downloading its metadata
|
||||
Torrent.Fields.Metadata = [
|
||||
'addedDate',
|
||||
'file-count',
|
||||
'added_date',
|
||||
'file_count',
|
||||
'name',
|
||||
'primary-mime-type',
|
||||
'totalSize',
|
||||
'primary_mime_type',
|
||||
'total_size',
|
||||
];
|
||||
|
||||
// commonly used fields which need to be periodically refreshed
|
||||
Torrent.Fields.Stats = [
|
||||
'error',
|
||||
'errorString',
|
||||
'error_string',
|
||||
'eta',
|
||||
'isFinished',
|
||||
'isStalled',
|
||||
'is_finished',
|
||||
'is_stalled',
|
||||
'labels',
|
||||
'leftUntilDone',
|
||||
'metadataPercentComplete',
|
||||
'peersConnected',
|
||||
'peersGettingFromUs',
|
||||
'peersSendingToUs',
|
||||
'percentDone',
|
||||
'queuePosition',
|
||||
'rateDownload',
|
||||
'rateUpload',
|
||||
'recheckProgress',
|
||||
'seedRatioMode',
|
||||
'seedRatioLimit',
|
||||
'sizeWhenDone',
|
||||
'left_until_done',
|
||||
'metadata_percent_complete',
|
||||
'peers_connected',
|
||||
'peers_getting_from_us',
|
||||
'peers_sending_to_us',
|
||||
'percent_done',
|
||||
'queue_position',
|
||||
'rate_download',
|
||||
'rate_upload',
|
||||
'recheck_progress',
|
||||
'seed_ratio_mode',
|
||||
'seed_ratio_limit',
|
||||
'size_when_done',
|
||||
'status',
|
||||
'trackers',
|
||||
'downloadDir',
|
||||
'uploadedEver',
|
||||
'uploadRatio',
|
||||
'webseedsSendingToUs',
|
||||
'download_dir',
|
||||
'uploaded_ever',
|
||||
'upload_ratio',
|
||||
'webseeds_sending_to_us',
|
||||
];
|
||||
|
||||
// fields used by the inspector which only need to be loaded once
|
||||
Torrent.Fields.InfoExtra = [
|
||||
'comment',
|
||||
'creator',
|
||||
'dateCreated',
|
||||
'date_created',
|
||||
'files',
|
||||
'hashString',
|
||||
'isPrivate',
|
||||
'magnetLink',
|
||||
'pieceCount',
|
||||
'pieceSize',
|
||||
'hash_string',
|
||||
'is_private',
|
||||
'magnet_link',
|
||||
'piece_count',
|
||||
'piece_size',
|
||||
];
|
||||
|
||||
// fields used in the inspector which need to be periodically refreshed
|
||||
Torrent.Fields.StatsExtra = [
|
||||
'activityDate',
|
||||
'corruptEver',
|
||||
'desiredAvailable',
|
||||
'downloadedEver',
|
||||
'fileStats',
|
||||
'haveUnchecked',
|
||||
'haveValid',
|
||||
'activity_date',
|
||||
'corrupt_ever',
|
||||
'desired_available',
|
||||
'downloaded_ever',
|
||||
'file_stats',
|
||||
'have_unchecked',
|
||||
'have_valid',
|
||||
'peers',
|
||||
'startDate',
|
||||
'trackerStats',
|
||||
'start_date',
|
||||
'tracker_stats',
|
||||
];
|
||||
|
||||
@@ -518,8 +518,8 @@ export class Transmission extends EventTarget {
|
||||
|
||||
seedRatioLimit() {
|
||||
const p = this.session_properties;
|
||||
if (p && p.seedRatioLimited) {
|
||||
return p.seedRatioLimit;
|
||||
if (p && p.seed_ratio_limited) {
|
||||
return p.seed_ratio_limit;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
@@ -749,7 +749,7 @@ export class Transmission extends EventTarget {
|
||||
}
|
||||
|
||||
shouldAddedTorrentsStart() {
|
||||
return this.session_properties['start-added-torrents'];
|
||||
return this.session_properties.start_added_torrents;
|
||||
}
|
||||
|
||||
_drop(event_) {
|
||||
@@ -891,7 +891,7 @@ TODO: fix this when notifications get fixed
|
||||
|
||||
refreshTorrents() {
|
||||
const fields = ['id', ...Torrent.Fields.Stats];
|
||||
this.updateTorrents('recently-active', fields);
|
||||
this.updateTorrents('recently_active', fields);
|
||||
}
|
||||
|
||||
_initializeTorrents() {
|
||||
|
||||
Reference in New Issue
Block a user