mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-02 21:52:32 -06:00
committed by
GitHub
parent
d173216941
commit
7527343629
@@ -427,12 +427,12 @@ bool AddNewTorrentDialog::loadTorrentFile(const QString &source)
|
||||
|
||||
bool AddNewTorrentDialog::loadTorrentImpl()
|
||||
{
|
||||
const auto torrentID = BitTorrent::TorrentID::fromInfoHash(m_torrentInfo.infoHash());
|
||||
const BitTorrent::InfoHash infoHash = m_torrentInfo.infoHash();
|
||||
|
||||
// Prevent showing the dialog if download is already present
|
||||
if (BitTorrent::Session::instance()->isKnownTorrent(torrentID))
|
||||
if (BitTorrent::Session::instance()->isKnownTorrent(infoHash))
|
||||
{
|
||||
BitTorrent::Torrent *const torrent = BitTorrent::Session::instance()->findTorrent(torrentID);
|
||||
BitTorrent::Torrent *const torrent = BitTorrent::Session::instance()->findTorrent(infoHash);
|
||||
if (torrent)
|
||||
{
|
||||
// Trying to set metadata to existing torrent in case if it has none
|
||||
@@ -480,11 +480,12 @@ bool AddNewTorrentDialog::loadMagnet(const BitTorrent::MagnetUri &magnetUri)
|
||||
|
||||
m_torrentGuard = std::make_unique<TorrentFileGuard>();
|
||||
|
||||
const auto torrentID = BitTorrent::TorrentID::fromInfoHash(magnetUri.infoHash());
|
||||
const BitTorrent::InfoHash infoHash = magnetUri.infoHash();
|
||||
|
||||
// Prevent showing the dialog if download is already present
|
||||
if (BitTorrent::Session::instance()->isKnownTorrent(torrentID))
|
||||
if (BitTorrent::Session::instance()->isKnownTorrent(infoHash))
|
||||
{
|
||||
BitTorrent::Torrent *const torrent = BitTorrent::Session::instance()->findTorrent(torrentID);
|
||||
BitTorrent::Torrent *const torrent = BitTorrent::Session::instance()->findTorrent(infoHash);
|
||||
if (torrent)
|
||||
{
|
||||
if (torrent->isPrivate())
|
||||
|
||||
@@ -411,7 +411,7 @@ void TorrentOptionsDialog::accept()
|
||||
auto *session = BitTorrent::Session::instance();
|
||||
for (const BitTorrent::TorrentID &id : asConst(m_torrentIDs))
|
||||
{
|
||||
BitTorrent::Torrent *torrent = session->findTorrent(id);
|
||||
BitTorrent::Torrent *torrent = session->getTorrent(id);
|
||||
if (!torrent) continue;
|
||||
|
||||
if (m_initialValues.autoTMM != m_ui->checkAutoTMM->checkState())
|
||||
|
||||
Reference in New Issue
Block a user