Don't merge trackers by default

PR #17446.
This commit is contained in:
Vladimir Golovnev
2022-07-29 15:40:40 +03:00
committed by GitHub
parent b98e7cb69f
commit 29f8b4b786
2 changed files with 20 additions and 33 deletions

View File

@@ -2502,32 +2502,7 @@ bool Session::addTorrent_impl(const std::variant<MagnetUri, TorrentInfo> &source
TorrentImpl *const torrent = m_torrents.value(id);
if (torrent)
{ // a duplicate torrent is added
if (torrent->isPrivate())
return false;
if (hasMetadata)
{
const TorrentInfo &torrentInfo = std::get<TorrentInfo>(source);
if (torrentInfo.isPrivate())
return false;
// merge trackers and web seeds
torrent->addTrackers(torrentInfo.trackers());
torrent->addUrlSeeds(torrentInfo.urlSeeds());
}
else
{
const MagnetUri &magnetUri = std::get<MagnetUri>(source);
// merge trackers and web seeds
torrent->addTrackers(magnetUri.trackers());
torrent->addUrlSeeds(magnetUri.urlSeeds());
}
return true;
}
return false;
LoadTorrentParams loadTorrentParams = initLoadTorrentParams(addTorrentParams);
lt::add_torrent_params &p = loadTorrentParams.ltAddTorrentParams;