Handle more torrent conflicts

PR #17668.
This is a continuation of #17576.
Handles the case when you add hybrid torrent by v1-only magnet link and this torrent is already known by its full hybrid info hash (i.e. by both v1 and v2 info hashes).
This commit is contained in:
Vladimir Golovnev
2022-09-05 06:22:42 +03:00
committed by GitHub
parent 4318de6dc5
commit 5cf6b1cbde
4 changed files with 88 additions and 35 deletions

View File

@@ -2014,10 +2014,10 @@ void TorrentImpl::handleMetadataReceivedAlert(const lt::metadata_received_alert
qDebug("Metadata received for torrent %s.", qUtf8Printable(name()));
#ifdef QBT_USES_LIBTORRENT2
const TorrentID prevTorrentID = id();
const InfoHash prevInfoHash = infoHash();
m_infoHash = InfoHash(m_nativeHandle.info_hashes());
if (prevTorrentID != id())
m_session->handleTorrentIDChanged(this, prevTorrentID);
if (prevInfoHash != infoHash())
m_session->handleTorrentInfoHashChanged(this, prevInfoHash);
#endif
m_maintenanceJob = MaintenanceJob::HandleMetadata;