summaryrefslogtreecommitdiff
path: root/src/downloadmanager.cpp
diff options
context:
space:
mode:
authorSilarn <jrim@rimpo.org>2018-08-20 18:34:31 -0500
committerSilarn <jrim@rimpo.org>2019-02-18 21:26:44 -0600
commit9fe2f6126dc7b9396d188b57ccb097f0035f57b7 (patch)
treedfb6038767f55238506122682b644ac86415050b /src/downloadmanager.cpp
parentbd9cc6254c8ded2f726e2b001a4ecf61ac0e5a1d (diff)
Initial Nexus API changes:
- Switch to SSO with WebSocket - Update endpoints (all but version checking)
Diffstat (limited to 'src/downloadmanager.cpp')
-rw-r--r--src/downloadmanager.cpp19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp
index ab8da7b8..c927695e 100644
--- a/src/downloadmanager.cpp
+++ b/src/downloadmanager.cpp
@@ -1536,10 +1536,10 @@ void DownloadManager::nxmFileInfoAvailable(QString gameName, int modID, int file
if (!info->version.isValid()) {
info->version = info->newestVersion;
}
- info->fileName = result["uri"].toString();
+ info->fileName = result["file_name"].toString();
info->fileCategory = result["category_id"].toInt();
- info->fileTime = matchDate(result["date"].toString());
- info->description = BBCode::convertToHTML(result["description"].toString());
+ info->fileTime = matchDate(result["uploaded_timestamp"].toString());
+ info->description = BBCode::convertToHTML(result["changelog_html"].toString());
info->repository = "Nexus";
info->gameName = gameName;
@@ -1554,23 +1554,12 @@ static int evaluateFileInfoMap(const QVariantMap &map, const std::map<QString, i
{
int result = 0;
- int users = map["ConnectedUsers"].toInt();
- // 0 users is probably a sign that the server is offline. Since there is currently no
- // mechanism to try a different server, we avoid those without users
- if (users == 0) {
- result -= 500;
- } else {
- result -= users;
- }
-
- auto preference = preferredServers.find(map["Name"].toString());
+ auto preference = preferredServers.find(map["name"].toString());
if (preference != preferredServers.end()) {
result += 100 + preference->second * 20;
}
- if (map["IsPremium"].toBool()) result += 5;
-
return result;
}