mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-23 04:54:18 +00:00
- Made seed detection a bit safer (do not use progress)
This commit is contained in:
parent
a3cfa6bba1
commit
384f3b23ee
@ -78,12 +78,12 @@ void EventManager::modifiedTorrent(QTorrentHandle h)
|
|||||||
}
|
}
|
||||||
event["name"] = QVariant(h.name());
|
event["name"] = QVariant(h.name());
|
||||||
event["size"] = QVariant((qlonglong)h.actual_size());
|
event["size"] = QVariant((qlonglong)h.actual_size());
|
||||||
if(h.progress() < 1.) {
|
if(!h.is_seed()) {
|
||||||
event["progress"] = QVariant(h.progress());
|
event["progress"] = QVariant(h.progress());
|
||||||
event["dlspeed"] = QVariant(h.download_payload_rate());
|
event["dlspeed"] = QVariant(h.download_payload_rate());
|
||||||
}
|
}
|
||||||
event["upspeed"] = QVariant(h.upload_payload_rate());
|
event["upspeed"] = QVariant(h.upload_payload_rate());
|
||||||
event["seed"] = QVariant(h.progress() == 1.);
|
event["seed"] = QVariant(h.is_seed());
|
||||||
event["hash"] = QVariant(hash);
|
event["hash"] = QVariant(hash);
|
||||||
event_list[hash] = event;
|
event_list[hash] = event;
|
||||||
}
|
}
|
||||||
|
@ -285,7 +285,10 @@ bool QTorrentHandle::is_seed() const {
|
|||||||
Q_ASSERT(h.is_valid());
|
Q_ASSERT(h.is_valid());
|
||||||
// Affected by bug http://code.rasterbar.com/libtorrent/ticket/402
|
// Affected by bug http://code.rasterbar.com/libtorrent/ticket/402
|
||||||
//return h.is_seed();
|
//return h.is_seed();
|
||||||
return (progress() == 1.);
|
// May suffer from approximation problems
|
||||||
|
//return (progress() == 1.);
|
||||||
|
// This looks safe
|
||||||
|
return (state() == torrent_status::finished || state() == torrent_status::seeding);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QTorrentHandle::is_auto_managed() const {
|
bool QTorrentHandle::is_auto_managed() const {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user