Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Feb 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions extras/rpc-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ The 'source' column here corresponds to the data structure there.
| `peersFrom` | object (see below)| n/a
| `peersGettingFromUs` | number| tr_stat
| `peersSendingToUs` | number| tr_stat
| `percentDone` | double| tr_stat
| `percentComplete` | double | tr_stat
| `percentDone` | double | tr_stat
| `pieces` | string (see below)| tr_torrent
| `pieceCount`| number| tr_torrent_view
| `pieceSize`| number| tr_torrent_view
Expand Down Expand Up @@ -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`
| `torrent-add` | new arg `labels`
| `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 `trackerStats.sitename`
| `torrent-get` | new arg `primary-mime-type`


### 5.1. Upcoming Breakage
Expand Down
3 changes: 2 additions & 1 deletion libtransmission/quark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ using namespace std::literals;
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,
"activity-date"sv,
"activityDate"sv,
Expand Down Expand Up @@ -230,6 +230,7 @@ auto constexpr my_static = std::array<std::string_view, 384>{ ""sv,
"peersFrom"sv,
"peersGettingFromUs"sv,
"peersSendingToUs"sv,
"percentComplete"sv,
"percentDone"sv,
"pex-enabled"sv,
"piece"sv,
Expand Down
1 change: 1 addition & 0 deletions libtransmission/quark.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ enum
TR_KEY_peersFrom,
TR_KEY_peersGettingFromUs,
TR_KEY_peersSendingToUs,
TR_KEY_percentComplete,
TR_KEY_percentDone,
TR_KEY_pex_enabled,
TR_KEY_piece,
Expand Down
4 changes: 4 additions & 0 deletions libtransmission/rpcimpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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));
break;

case TR_KEY_percentComplete:
tr_variantInitReal(initme, st->percentComplete);
break;

case TR_KEY_percentDone:
tr_variantInitReal(initme, st->percentDone);
break;
Expand Down