mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 07:27:22 -06:00
Merge trackers when torrent already exists instead of showing an AddNewTorrent dialog.
This commit is contained in:
@@ -188,6 +188,13 @@ bool AddNewTorrentDialog::loadTorrent(const QString& torrent_path, const QString
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Prevent showing the dialog if download is already present
|
||||||
|
if (QBtSession::instance()->getTorrentHandle(m_hash).is_valid()) {
|
||||||
|
QMessageBox::information(0, tr("Already in download list"), tr("Torrent is already in download list. Merging trackers."), QMessageBox::Ok);
|
||||||
|
QBtSession::instance()->addTorrent(m_filePath, false, m_url);;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Set dialog title
|
// Set dialog title
|
||||||
setWindowTitle(misc::toQStringU(m_torrentInfo->name()));
|
setWindowTitle(misc::toQStringU(m_torrentInfo->name()));
|
||||||
|
|
||||||
@@ -260,7 +267,7 @@ bool AddNewTorrentDialog::loadMagnet(const QString &magnet_uri)
|
|||||||
|
|
||||||
// Prevent showing the dialog if download is already present
|
// Prevent showing the dialog if download is already present
|
||||||
if (QBtSession::instance()->getTorrentHandle(m_hash).is_valid()) {
|
if (QBtSession::instance()->getTorrentHandle(m_hash).is_valid()) {
|
||||||
QMessageBox::information(0, tr("Already in download list"), tr("Magnet link is already in download list."), QMessageBox::Ok);
|
QMessageBox::information(0, tr("Already in download list"), tr("Magnet link is already in download list. Merging trackers."), QMessageBox::Ok);
|
||||||
QBtSession::instance()->addMagnetUri(m_url, false);
|
QBtSession::instance()->addMagnetUri(m_url, false);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user