mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 15:37:26 -06:00
Make TorrentInfo immutable
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user