mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-10 23:07:59 +00:00
- Paused torrents can now be rechecked
This commit is contained in:
parent
cbd948f6f3
commit
1840d1c49f
@ -1915,12 +1915,30 @@ void Bittorrent::addConsoleMessage(QString msg, QString) {
|
||||
}
|
||||
emit torrentFinishedChecking(h);
|
||||
emit metadataReceived(h);
|
||||
if(torrentsToPausedAfterChecking.contains(hash)) {
|
||||
torrentsToPausedAfterChecking.removeOne(hash);
|
||||
h.pause();
|
||||
emit pausedTorrent(h);
|
||||
}
|
||||
}
|
||||
}
|
||||
a = s->pop_alert();
|
||||
}
|
||||
}
|
||||
|
||||
void Bittorrent::recheckTorrent(QString hash) {
|
||||
QTorrentHandle h = getTorrentHandle(hash);
|
||||
if(h.is_valid() && h.has_metadata()) {
|
||||
if(h.is_paused()) {
|
||||
if(!torrentsToPausedAfterChecking.contains(h.hash())) {
|
||||
torrentsToPausedAfterChecking << h.hash();
|
||||
h.resume();
|
||||
}
|
||||
}
|
||||
h.force_recheck();
|
||||
}
|
||||
}
|
||||
|
||||
QHash<QString, TrackerInfos> Bittorrent::getTrackersInfo(QString hash) const{
|
||||
return trackersInfos.value(hash, QHash<QString, TrackerInfos>());
|
||||
}
|
||||
|
@ -94,6 +94,7 @@ private:
|
||||
QPointer<QTimer> timerAlerts;
|
||||
QMap<QUrl, QString> savepath_fromurl;
|
||||
QHash<QString, QHash<QString, TrackerInfos> > trackersInfos;
|
||||
QStringList torrentsToPausedAfterChecking;
|
||||
// Ratio
|
||||
QPointer<QTimer> BigRatioTimer;
|
||||
// HTTP
|
||||
@ -180,6 +181,7 @@ public slots:
|
||||
void deleteTorrent(QString hash, bool delete_local_files = false);
|
||||
void startUpTorrents();
|
||||
session_proxy asyncDeletion();
|
||||
void recheckTorrent(QString hash);
|
||||
/* Needed by Web UI */
|
||||
void pauseAllTorrents();
|
||||
void pauseTorrent(QString hash);
|
||||
|
@ -456,8 +456,8 @@ void HttpConnection::respondCommand(QString command)
|
||||
|
||||
void HttpConnection::recheckTorrent(QString hash) {
|
||||
QTorrentHandle h = BTSession->getTorrentHandle(hash);
|
||||
if(h.is_valid() && !h.is_paused()){
|
||||
h.force_recheck();
|
||||
if(h.is_valid()){
|
||||
BTSession->recheckTorrent(h.hash());
|
||||
}
|
||||
}
|
||||
|
||||
@ -466,7 +466,7 @@ void HttpConnection::recheckAllTorrents() {
|
||||
std::vector<torrent_handle>::iterator torrentIT;
|
||||
for(torrentIT = torrents.begin(); torrentIT != torrents.end(); torrentIT++) {
|
||||
QTorrentHandle h = QTorrentHandle(*torrentIT);
|
||||
if(h.is_valid() && !h.is_paused())
|
||||
h.force_recheck();
|
||||
if(h.is_valid())
|
||||
BTSession->recheckTorrent(h.hash());
|
||||
}
|
||||
}
|
||||
|
@ -760,8 +760,9 @@ void TransferListWidget::recheckSelectedTorrents() {
|
||||
foreach(const QModelIndex &index, selectedIndexes){
|
||||
QString hash = getHashFromRow(mapToSource(index).row());
|
||||
QTorrentHandle h = BTSession->getTorrentHandle(hash);
|
||||
if(h.is_valid() && h.has_metadata())
|
||||
h.force_recheck();
|
||||
if(h.is_valid()) {
|
||||
BTSession->recheckTorrent(h.hash());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user