Make TorrentInfo immutable

This commit is contained in:
Vladimir Golovnev (Glassez) 2021-12-09 13:05:49 +03:00
parent 9d2bb67834
commit 62b50d1475
No known key found for this signature in database
GPG key ID: 52A2C7DEE2DFA6F7
22 changed files with 382 additions and 255 deletions

View file

@ -573,10 +573,12 @@ void SyncController::torrentPeersAction()
{KEY_PEER_CONNECTION_TYPE, pi.connectionType()},
{KEY_PEER_FLAGS, pi.flags()},
{KEY_PEER_FLAGS_DESCRIPTION, pi.flagsDescription()},
{KEY_PEER_RELEVANCE, pi.relevance()},
{KEY_PEER_FILES, torrent->info().filesForPiece(pi.downloadingPieceIndex()).join('\n')}
{KEY_PEER_RELEVANCE, pi.relevance()}
};
if (torrent->hasMetadata())
peer.insert(KEY_PEER_FILES, torrent->info().filesForPiece(pi.downloadingPieceIndex()).join('\n'));
if (resolvePeerCountries)
{
peer[KEY_PEER_COUNTRY_CODE] = pi.country().toLower();