Merge pull request #14039 from Chocobo1/stats

Don't use removed stat metric in libtorrent 2.0
This commit is contained in:
Mike Tzou
2020-12-25 17:55:56 +08:00
committed by GitHub
6 changed files with 77 additions and 101 deletions

View File

@@ -134,7 +134,7 @@ namespace
map[KEY_TRANSFER_GLOBAL_RATIO] = ((atd > 0) && (atu > 0)) ? Utils::String::fromDouble(static_cast<qreal>(atu) / atd, 2) : "-";
map[KEY_TRANSFER_TOTAL_PEER_CONNECTIONS] = sessionStatus.peersCount;
const qreal readRatio = cacheStatus.readRatio;
const qreal readRatio = cacheStatus.readRatio; // TODO: remove when LIBTORRENT_VERSION_NUM >= 20000
map[KEY_TRANSFER_READ_CACHE_HITS] = (readRatio > 0) ? Utils::String::fromDouble(100 * readRatio, 2) : "0";
map[KEY_TRANSFER_TOTAL_BUFFERS_SIZE] = cacheStatus.totalUsedBuffers * 16 * 1024;