summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/downloadmanager.cpp4
-rw-r--r--src/mainwindow.cpp7
2 files changed, 5 insertions, 6 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;
}
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index ce476143..a17b51d5 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -5622,11 +5622,10 @@ void MainWindow::nxmDownloadURLs(QString, int, int, QVariant, QVariant resultDat
for (const QVariant &server : serverList) {
QVariantMap serverInfo = server.toMap();
ServerInfo info;
- info.name = serverInfo["Name"].toString();
- info.premium = serverInfo["IsPremium"].toBool();
+ info.name = serverInfo["short_name"].toString();
+ info.premium = serverInfo["name"].toString().contains("Premium", Qt::CaseInsensitive);
info.lastSeen = QDate::currentDate();
- info.preferred = !info.name.compare("CDN", Qt::CaseInsensitive);
- // other keys: ConnectedUsers, Country, URI
+ info.preferred = serverInfo["short_name"].toString().contains("CDN", Qt::CaseInsensitive);
servers.append(info);
}
m_OrganizerCore.settings().updateServers(servers);