Expose files' begin and end pieces via RPC (#5578)

* Expose files' begin and end pieces via RPC

This adds two arguments, `beginPiece` and `endPiece`, for each of the entries
in the `files` array of the RPC's `torrent-`get` method.

The point is to allow RPC clients to display a file's completion progress as
piece-based in addition to byte-based.
This commit is contained in:
Daniel Kamil Kozar
2023-06-05 20:15:32 +02:00
committed by GitHub
parent 61679e1adc
commit c1c27f3da0
7 changed files with 29 additions and 4 deletions

View File

@@ -294,6 +294,8 @@ The 'source' column here corresponds to the data structure there.
| `bytesCompleted` | number | tr_file_view
| `length` | number | tr_file_view
| `name` | string | tr_file_view
| `beginPiece` | number | tr_file_view
| `endPiece` | number | tr_file_view
`fileStats`: a file's non-constant properties. An array of `tr_info.filecount` objects, each containing:
@@ -1009,3 +1011,5 @@ Transmission 4.1.0 (`rpc-version-semver` 5.4.0, `rpc-version`: 18)
|:---|:---
| `torrent-get` | new arg `sequentialDownload`
| `torrent-set` | new arg `sequentialDownload`
| `torrent-get` | new arg `files.beginPiece`
| `torrent-get` | new arg `files.endPiece`