diff options
| author | Silarn <jrim@rimpo.org> | 2019-02-06 17:09:32 -0600 |
|---|---|---|
| committer | Silarn <jrim@rimpo.org> | 2019-02-18 21:31:20 -0600 |
| commit | b59c44aaa16fc286159059a2b940c144a577e01a (patch) | |
| tree | 23e606d9481326008dc42f4d3a26b64418445d99 /src/downloadmanager.cpp | |
| parent | 3f86a94ff73914460db72c1f20eca075de8caea6 (diff) | |
Some fixes to parse the preferred server list and download speed feature
Diffstat (limited to 'src/downloadmanager.cpp')
| -rw-r--r-- | src/downloadmanager.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index 1db8b0eb..24942a06 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -1561,7 +1561,7 @@ static int evaluateFileInfoMap(const QVariantMap &map, const std::map<QString, i { int result = 0; - auto preference = preferredServers.find(map["name"].toString()); + auto preference = preferredServers.find(map["short_name"].toString()); if (preference != preferredServers.end()) { result += 100 + preference->second * 20; @@ -1742,7 +1742,7 @@ void DownloadManager::downloadFinished(int index) if (serverMap["URI"].toString() == url) { int deltaTime = info->m_StartTime.secsTo(QTime::currentTime()); if (deltaTime > 5) { - emit downloadSpeed(serverMap["Name"].toString(), (info->m_TotalSize - info->m_PreResumeSize) / deltaTime); + emit downloadSpeed(serverMap["short_name"].toString(), (info->m_TotalSize - info->m_PreResumeSize) / deltaTime); } // no division by zero please! Also, if the download is shorter than a few seconds, the result is way to inprecise break; } |
