mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 21:03:30 -07:00
Make TorrentInfo immutable
This commit is contained in:
parent
9d2bb67834
commit
62b50d1475
22 changed files with 382 additions and 255 deletions
|
@ -594,9 +594,12 @@ void TorrentsController::pieceHashesAction()
|
|||
throw APIError(APIErrorType::NotFound);
|
||||
|
||||
QJsonArray pieceHashes;
|
||||
const QVector<QByteArray> hashes = torrent->info().pieceHashes();
|
||||
for (const QByteArray &hash : hashes)
|
||||
pieceHashes.append(QString(hash.toHex()));
|
||||
if (torrent->hasMetadata())
|
||||
{
|
||||
const QVector<QByteArray> hashes = torrent->info().pieceHashes();
|
||||
for (const QByteArray &hash : hashes)
|
||||
pieceHashes.append(QString(hash.toHex()));
|
||||
}
|
||||
|
||||
setResult(pieceHashes);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue