From d413f673e880eb84b4c7dbc2143322e7dd506e6d Mon Sep 17 00:00:00 2001 From: AL <26797547+Al12rs@users.noreply.github.com> Date: Mon, 12 Jul 2021 02:33:05 +0200 Subject: Added ARCHIVED support for nexus update check and download query. Use FileStatus enum instead of scattered int literals. Re-wrote the update check code --- src/downloadmanager.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/downloadmanager.cpp') diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index 4c8e820f..73e6abde 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -1223,6 +1223,7 @@ QString DownloadManager::getFileTypeString(int fileType) case 4: return tr("Old"); case 5: return tr("Miscellaneous"); case 6: return tr("Deleted"); + case 7: return tr("Archived"); default: return tr("Unknown"); } } @@ -1723,7 +1724,8 @@ void DownloadManager::nxmFilesAvailable(QString, int, QVariant userData, QVarian {return lhs.toMap()["uploaded_timestamp"].toInt() > rhs.toMap()["uploaded_timestamp"].toInt();}); for (QVariant file : files) { QVariantMap fileInfo = file.toMap(); - if (fileInfo["category_id"].toInt() != 6) + if (fileInfo["category_id"].toInt() != NexusInterface::FileStatus::REMOVED && + fileInfo["category_id"].toInt() != NexusInterface::FileStatus::ARCHIVED) selection.addChoice(fileInfo["file_name"].toString(), "", file); } if (selection.exec() == QDialog::Accepted) { @@ -1958,7 +1960,8 @@ void DownloadManager::nxmFileInfoFromMd5Available(QString gameName, QVariant use auto results = resultlist[i].toMap(); auto fileDetails = results["file_details"].toMap(); - if (fileDetails["category_id"].toInt() != 6) { //6 = deleted + if (fileDetails["category_id"].toInt() != NexusInterface::FileStatus::REMOVED && + fileDetails["category_id"].toInt() != NexusInterface::FileStatus::ARCHIVED) { if (chosenIdx < 0) { chosenIdx = i; //intentional to not break in order to check other results } else { -- cgit v1.3.1