1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-02-05 03:14:44 +00:00

Make qBittorrent compatible with libtorrent master

PR #17604.
This commit is contained in:
Vladimir Golovnev 2022-08-28 11:38:28 +03:00 committed by GitHub
parent f6e2715f4a
commit 794a92f911
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -1416,7 +1416,13 @@ void SessionImpl::initializeNativeSession()
break;
}
#endif
#if LIBTORRENT_VERSION_NUM < 20100
m_nativeSession = new lt::session(sessionParams, lt::session::paused);
#else
m_nativeSession = new lt::session(sessionParams);
m_nativeSession->pause();
#endif
LogMsg(tr("Peer ID: \"%1\"").arg(QString::fromStdString(peerId)), Log::INFO);
LogMsg(tr("HTTP User-Agent: \"%1\"").arg(USER_AGENT), Log::INFO);

View File

@ -30,6 +30,7 @@
#include <libtorrent/create_torrent.hpp>
#include <libtorrent/error_code.hpp>
#include <libtorrent/version.hpp>
#include <QByteArray>
#include <QDateTime>
@ -292,8 +293,12 @@ QVector<QUrl> TorrentInfo::urlSeeds() const
for (const lt::web_seed_entry &webSeed : nativeWebSeeds)
{
#if LIBTORRENT_VERSION_NUM < 20100
if (webSeed.type == lt::web_seed_entry::url_seed)
urlSeeds.append(QUrl(QString::fromStdString(webSeed.url)));
#else
urlSeeds.append(QUrl(QString::fromStdString(webSeed.url)));
#endif
}
return urlSeeds;