1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-01-03 05:25:52 +00:00

Add support for torrent-get calls with the key percentComplete (#2615)

Co-authored-by: Michael Hadam <michael@hadam.us>
This commit is contained in:
Charles Kerr 2022-02-13 01:27:47 -06:00 committed by GitHub
parent 96178b1a9f
commit 83db648b3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 3 deletions

View file

@ -248,6 +248,7 @@ The 'source' column here corresponds to the data structure there.
| `peersFrom` | object (see below)| n/a | `peersFrom` | object (see below)| n/a
| `peersGettingFromUs` | number| tr_stat | `peersGettingFromUs` | number| tr_stat
| `peersSendingToUs` | number| tr_stat | `peersSendingToUs` | number| tr_stat
| `percentComplete` | double | tr_stat
| `percentDone` | double | tr_stat | `percentDone` | double | tr_stat
| `pieces` | string (see below)| tr_torrent | `pieces` | string (see below)| tr_torrent
| `pieceCount`| number| tr_torrent_view | `pieceCount`| number| tr_torrent_view
@ -938,9 +939,10 @@ Transmission 4.0.0 (`rpc-version-semver` 5.3.0, `rpc-version`: 17)
| `session-get` | new arg `script-torrent-added-filename` | `session-get` | new arg `script-torrent-added-filename`
| `torrent-add` | new arg `labels` | `torrent-add` | new arg `labels`
| `torrent-get` | new arg `file-count` | `torrent-get` | new arg `file-count`
| `torrent-get` | new arg `percentComplete`
| `torrent-get` | new arg `primary-mime-type`
| `torrent-get` | new arg `tracker.sitename` | `torrent-get` | new arg `tracker.sitename`
| `torrent-get` | new arg `trackerStats.sitename` | `torrent-get` | new arg `trackerStats.sitename`
| `torrent-get` | new arg `primary-mime-type`
### 5.1. Upcoming Breakage ### 5.1. Upcoming Breakage

View file

@ -18,7 +18,7 @@ using namespace std::literals;
namespace namespace
{ {
auto constexpr my_static = std::array<std::string_view, 384>{ ""sv, auto constexpr my_static = std::array<std::string_view, 385>{ ""sv,
"activeTorrentCount"sv, "activeTorrentCount"sv,
"activity-date"sv, "activity-date"sv,
"activityDate"sv, "activityDate"sv,
@ -230,6 +230,7 @@ auto constexpr my_static = std::array<std::string_view, 384>{ ""sv,
"peersFrom"sv, "peersFrom"sv,
"peersGettingFromUs"sv, "peersGettingFromUs"sv,
"peersSendingToUs"sv, "peersSendingToUs"sv,
"percentComplete"sv,
"percentDone"sv, "percentDone"sv,
"pex-enabled"sv, "pex-enabled"sv,
"piece"sv, "piece"sv,

View file

@ -233,6 +233,7 @@ enum
TR_KEY_peersFrom, TR_KEY_peersFrom,
TR_KEY_peersGettingFromUs, TR_KEY_peersGettingFromUs,
TR_KEY_peersSendingToUs, TR_KEY_peersSendingToUs,
TR_KEY_percentComplete,
TR_KEY_percentDone, TR_KEY_percentDone,
TR_KEY_pex_enabled, TR_KEY_pex_enabled,
TR_KEY_piece, TR_KEY_piece,

View file

@ -633,6 +633,10 @@ static void initField(tr_torrent const* const tor, tr_stat const* const st, tr_v
tr_variantInitStrView(initme, tr_torrentName(tor)); tr_variantInitStrView(initme, tr_torrentName(tor));
break; break;
case TR_KEY_percentComplete:
tr_variantInitReal(initme, st->percentComplete);
break;
case TR_KEY_percentDone: case TR_KEY_percentDone:
tr_variantInitReal(initme, st->percentDone); tr_variantInitReal(initme, st->percentDone);
break; break;