Use appropriate type

This commit is contained in:
Chocobo1
2019-06-18 23:36:45 +08:00
parent 516c968373
commit 4880dc812c
3 changed files with 5 additions and 5 deletions

View File

@@ -324,10 +324,10 @@ void TorrentsController::propertiesAction()
dataDict[KEY_PROP_UPLOADED] = torrent->totalUpload();
dataDict[KEY_PROP_UPLOADED_SESSION] = torrent->totalPayloadUpload();
dataDict[KEY_PROP_DL_SPEED] = torrent->downloadPayloadRate();
const int dlDuration = torrent->activeTime() - torrent->finishedTime();
const qlonglong dlDuration = torrent->activeTime() - torrent->finishedTime();
dataDict[KEY_PROP_DL_SPEED_AVG] = torrent->totalDownload() / ((dlDuration == 0) ? -1 : dlDuration);
dataDict[KEY_PROP_UP_SPEED] = torrent->uploadPayloadRate();
const int ulDuration = torrent->activeTime();
const qlonglong ulDuration = torrent->activeTime();
dataDict[KEY_PROP_UP_SPEED_AVG] = torrent->totalUpload() / ((ulDuration == 0) ? -1 : ulDuration);
dataDict[KEY_PROP_DL_LIMIT] = torrent->downloadLimit() <= 0 ? -1 : torrent->downloadLimit();
dataDict[KEY_PROP_UP_LIMIT] = torrent->uploadLimit() <= 0 ? -1 : torrent->uploadLimit();