diff --git a/src/base/bittorrent/torrentinfo.cpp b/src/base/bittorrent/torrentinfo.cpp index 716b25983..a6f44c873 100644 --- a/src/base/bittorrent/torrentinfo.cpp +++ b/src/base/bittorrent/torrentinfo.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -294,7 +295,12 @@ QVector TorrentInfo::urlSeeds() const QByteArray TorrentInfo::metadata() const { if (!isValid()) return {}; +#if (LIBTORRENT_VERSION_NUM >= 20000) + const lt::span infoSection {m_nativeInfo->info_section()}; + return {infoSection.data(), static_cast(infoSection.size())}; +#else return {m_nativeInfo->metadata().get(), m_nativeInfo->metadata_size()}; +#endif } QStringList TorrentInfo::filesForPiece(const int pieceIndex) const