Provide v1 and v2 infohashes in UI (#15097)

This commit is contained in:
Vladimir Golovnev
2021-06-25 20:44:23 +03:00
committed by GitHub
parent f6eb29d800
commit 37f227ae74
24 changed files with 285 additions and 106 deletions

View File

@@ -96,8 +96,9 @@ QVariantMap serialize(const BitTorrent::Torrent &torrent)
};
return {
// TODO: Add fields for real SHA1 and SHA256 hashes
{KEY_TORRENT_ID, QString(torrent.id().toString())},
{KEY_TORRENT_ID, torrent.id().toString()},
{KEY_TORRENT_INFOHASHV1, torrent.infoHash().v1().toString()},
{KEY_TORRENT_INFOHASHV2, torrent.infoHash().v2().toString()},
{KEY_TORRENT_NAME, torrent.name()},
{KEY_TORRENT_MAGNET_URI, torrent.createMagnetURI()},
{KEY_TORRENT_SIZE, torrent.wantedSize()},

View File

@@ -36,7 +36,10 @@ namespace BitTorrent
}
// Torrent keys
// TODO: Rename it to `id`.
inline const char KEY_TORRENT_ID[] = "hash";
inline const char KEY_TORRENT_INFOHASHV1[] = "infohash_v1";
inline const char KEY_TORRENT_INFOHASHV2[] = "infohash_v2";
inline const char KEY_TORRENT_NAME[] = "name";
inline const char KEY_TORRENT_MAGNET_URI[] = "magnet_uri";
inline const char KEY_TORRENT_SIZE[] = "size";