Add new webUI API. Closes #6457.

Now getting piece information for a specific torrent is possible via:

* Returns an array of states (integers) of pieces in order. Defined as:
  "0=not downloaded", "1=downloading", "2=downloaded".
  GET /query/getPieceStates/<torrent_hash>

* Returns an array of hashes (strings) of pieces in order:
  GET /query/getPieceHashes/<torrent_hash>
This commit is contained in:
Chocobo1
2017-04-06 00:36:00 +08:00
parent 47960b2592
commit 3933790bda
6 changed files with 88 additions and 1 deletions

View File

@@ -91,6 +91,7 @@ namespace BitTorrent
QByteArray metadata() const;
QStringList filesForPiece(int pieceIndex) const;
QVector<int> fileIndicesForPiece(int pieceIndex) const;
QVector<QByteArray> pieceHashes() const;
using PieceRange = IndexRange<int>;
// returns pair of the first and the last pieces into which