mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-01 13:18:06 -06:00
committed by
GitHub
parent
8e6515be2c
commit
f37d0c486c
@@ -152,6 +152,7 @@ QVariantMap serialize(const BitTorrent::Torrent &torrent)
|
||||
{KEY_TORRENT_MAX_INACTIVE_SEEDING_TIME, torrent.maxInactiveSeedingTime()},
|
||||
{KEY_TORRENT_RATIO, adjustRatio(torrent.realRatio())},
|
||||
{KEY_TORRENT_RATIO_LIMIT, torrent.ratioLimit()},
|
||||
{KEY_TORRENT_POPULARITY, torrent.popularity()},
|
||||
{KEY_TORRENT_SEEDING_TIME_LIMIT, torrent.seedingTimeLimit()},
|
||||
{KEY_TORRENT_INACTIVE_SEEDING_TIME_LIMIT, torrent.inactiveSeedingTimeLimit()},
|
||||
{KEY_TORRENT_LAST_SEEN_COMPLETE_TIME, Utils::DateTime::toSecsSinceEpoch(torrent.lastSeenComplete())},
|
||||
|
||||
@@ -54,6 +54,7 @@ inline const QString KEY_TORRENT_NUM_COMPLETE = u"num_complete"_s;
|
||||
inline const QString KEY_TORRENT_LEECHS = u"num_leechs"_s;
|
||||
inline const QString KEY_TORRENT_NUM_INCOMPLETE = u"num_incomplete"_s;
|
||||
inline const QString KEY_TORRENT_RATIO = u"ratio"_s;
|
||||
inline const QString KEY_TORRENT_POPULARITY = u"popularity"_s;
|
||||
inline const QString KEY_TORRENT_ETA = u"eta"_s;
|
||||
inline const QString KEY_TORRENT_STATE = u"state"_s;
|
||||
inline const QString KEY_TORRENT_SEQUENTIAL_DOWNLOAD = u"seq_dl"_s;
|
||||
|
||||
@@ -97,6 +97,7 @@ const QString KEY_PROP_SEEDS_TOTAL = u"seeds_total"_s;
|
||||
const QString KEY_PROP_PEERS = u"peers"_s;
|
||||
const QString KEY_PROP_PEERS_TOTAL = u"peers_total"_s;
|
||||
const QString KEY_PROP_RATIO = u"share_ratio"_s;
|
||||
const QString KEY_PROP_POPULARITY = u"popularity"_s;
|
||||
const QString KEY_PROP_REANNOUNCE = u"reannounce"_s;
|
||||
const QString KEY_PROP_TOTAL_SIZE = u"total_size"_s;
|
||||
const QString KEY_PROP_PIECES_NUM = u"pieces_num"_s;
|
||||
@@ -398,6 +399,7 @@ void TorrentsController::infoAction()
|
||||
// - "peers": Torrent connected peers
|
||||
// - "peers_total": Torrent total number of peers
|
||||
// - "share_ratio": Torrent share ratio
|
||||
// - "popularity": Torrent popularity
|
||||
// - "reannounce": Torrent next reannounce time
|
||||
// - "total_size": Torrent total size
|
||||
// - "pieces_num": Torrent pieces count
|
||||
@@ -432,6 +434,7 @@ void TorrentsController::propertiesAction()
|
||||
const int downloadLimit = torrent->downloadLimit();
|
||||
const int uploadLimit = torrent->uploadLimit();
|
||||
const qreal ratio = torrent->realRatio();
|
||||
const qreal popularity = torrent->popularity();
|
||||
|
||||
const QJsonObject ret
|
||||
{
|
||||
@@ -460,6 +463,7 @@ void TorrentsController::propertiesAction()
|
||||
{KEY_PROP_PEERS, torrent->leechsCount()},
|
||||
{KEY_PROP_PEERS_TOTAL, torrent->totalLeechersCount()},
|
||||
{KEY_PROP_RATIO, ((ratio > BitTorrent::Torrent::MAX_RATIO) ? -1 : ratio)},
|
||||
{KEY_PROP_POPULARITY, ((popularity > BitTorrent::Torrent::MAX_RATIO) ? -1 : popularity)},
|
||||
{KEY_PROP_REANNOUNCE, torrent->nextAnnounce()},
|
||||
{KEY_PROP_TOTAL_SIZE, torrent->totalSize()},
|
||||
{KEY_PROP_PIECES_NUM, torrent->piecesCount()},
|
||||
|
||||
Reference in New Issue
Block a user