mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 13:23:34 -07:00
parent
d173216941
commit
7527343629
9 changed files with 188 additions and 60 deletions
|
@ -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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue