Don't use removed stat metric in libtorrent 2.0

For now, the metric is not entirely removed due to WebAPI still needs to
access it.
This commit is contained in:
Chocobo1 2020-12-24 11:54:33 +08:00
parent 0ebd864db9
commit 90a1ea4281
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
6 changed files with 20 additions and 6 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;