mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 17:23:07 -07:00
Automatically add trackers to new downloads.
This commit is contained in:
parent
5cb022c7b1
commit
9c7bb08a03
6 changed files with 76 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
|||
|
||||
/*
|
||||
* Bittorrent Client using Qt and libtorrent.
|
||||
* Copyright (C) 2015 Vladimir Golovnev <glassez@yandex.ru>
|
||||
|
@ -620,6 +621,16 @@ void Session::configure()
|
|||
qDebug("Applying encryption settings");
|
||||
m_nativeSession->set_pe_settings(encryptionSettings);
|
||||
|
||||
// * Add trackers
|
||||
m_additionalTrackers.empty();
|
||||
if (pref->isAddTrackersEnabled()) {
|
||||
foreach (QString tracker, pref->getTrackersList().split("\n")) {
|
||||
tracker = tracker.trimmed();
|
||||
if (!tracker.isEmpty())
|
||||
m_additionalTrackers << tracker;
|
||||
}
|
||||
}
|
||||
|
||||
// * Maximum ratio
|
||||
m_highRatioAction = pref->getMaxRatioAction();
|
||||
setGlobalMaxRatio(pref->getGlobalMaxRatio());
|
||||
|
@ -2111,6 +2122,9 @@ void Session::handleAddTorrentAlert(libtorrent::add_torrent_alert *p)
|
|||
}
|
||||
}
|
||||
|
||||
if (pref->isAddTrackersEnabled() && !torrent->isPrivate())
|
||||
torrent->addTrackers(m_additionalTrackers);
|
||||
|
||||
bool addPaused = data.addPaused;
|
||||
if (data.addPaused == TriStateBool::Undefined)
|
||||
addPaused = pref->addTorrentsInPause();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue