mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-08 06:00:59 -07:00
Group setting torrents upload limit
This commit is contained in:
parent
facab1681a
commit
cf55751fbe
7 changed files with 56 additions and 33 deletions
|
@ -539,6 +539,21 @@ QVariantMap getTranserInfoMap()
|
|||
return map;
|
||||
}
|
||||
|
||||
QByteArray btjson::getTorrentsRatesLimits(QStringList &hashes, bool downloadLimits)
|
||||
{
|
||||
QVariantMap map;
|
||||
|
||||
foreach (const QString &hash, hashes) {
|
||||
int limit = -1;
|
||||
QTorrentHandle h = QBtSession::instance()->getTorrentHandle(hash);
|
||||
if (h.is_valid())
|
||||
limit = downloadLimits ? h.download_limit() : h.upload_limit();
|
||||
map[hash] = limit;
|
||||
}
|
||||
|
||||
return json::toJson(map);
|
||||
}
|
||||
|
||||
QVariantMap toMap(const QTorrentHandle& h)
|
||||
{
|
||||
libtorrent::torrent_status status = h.status(torrent_handle::query_accurate_download_counters);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue