mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 07:27:22 -06:00
Improve "info hash" handling
Define "torrent ID" concept, which is either a SHA1 hash for torrents of version 1, or a SHA256 hash (truncated to SHA1 hash length) for torrents of version 2. Add support for native libtorrent2 info hashes.
This commit is contained in:
@@ -103,7 +103,8 @@ QVariantMap serialize(const BitTorrent::Torrent &torrent)
|
||||
};
|
||||
|
||||
return {
|
||||
{KEY_TORRENT_HASH, QString(torrent.hash().toString())},
|
||||
// TODO: Add fields for real SHA1 and SHA256 hashes
|
||||
{KEY_TORRENT_ID, QString(torrent.id().toString())},
|
||||
{KEY_TORRENT_NAME, torrent.name()},
|
||||
{KEY_TORRENT_MAGNET_URI, torrent.createMagnetURI()},
|
||||
{KEY_TORRENT_SIZE, torrent.wantedSize()},
|
||||
|
||||
Reference in New Issue
Block a user