When duplicate torrent is added set metadata to existing one

PR #17454. 
Closes #907.
This commit is contained in:
Vladimir Golovnev 2022-07-31 08:53:26 +03:00 committed by GitHub
commit 1c0479a795
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 26 additions and 0 deletions

View file

@ -435,6 +435,9 @@ bool AddNewTorrentDialog::loadTorrentImpl()
BitTorrent::Torrent *const torrent = BitTorrent::Session::instance()->findTorrent(torrentID);
if (torrent)
{
// Trying to set metadata to existing torrent in case if it has none
torrent->setMetadata(m_torrentInfo);
if (torrent->isPrivate() || m_torrentInfo.isPrivate())
{
RaisedMessageBox::warning(this, tr("Torrent is already present"), tr("Torrent '%1' is already in the transfer list. Trackers cannot be merged because it is a private torrent.").arg(torrent->name()), QMessageBox::Ok);