From ca7a149874e99a8f401cb30c430f58a48be4c642 Mon Sep 17 00:00:00 2001 From: Al <26797547+Al12rs@users.noreply.github.com> Date: Mon, 4 May 2026 04:47:20 +0200 Subject: Improve mod update check accuracy (#2385) * Index API response into lookup maps * extract new findLatestActiveSuccessor method from update check function * extract method to check if a file is active * use new isActiveFileStatus in modInfoRegular * fix bug when merging during mod install * remember ordering of installed nexus file ids * refactor update check logic to prioritize Nexus file IDs over filenames * refactor nxmUpdatesAvailable to simplify update checking logic * refactor update check logic to find Nexus file IDs by filename and streamline successor retrieval * refactor update checking to streamline version resolution and improve successor retrieval --- src/nexusinterface.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/nexusinterface.h') diff --git a/src/nexusinterface.h b/src/nexusinterface.h index f6efef1d..dd9650b1 100644 --- a/src/nexusinterface.h +++ b/src/nexusinterface.h @@ -183,6 +183,31 @@ public: // listed we can assume they were hidden. }; + /** + * @brief Whether a Nexus file category represents a file that is still + * listed and considered current on the mod page. + * + * Inactive (false) refers to files that have been marked as obsolete or have been + * removed. + */ + static bool isActiveFileStatus(int status) + { + switch (status) { + case FileStatus::MAIN: + case FileStatus::UPDATE: + case FileStatus::OPTIONAL_FILE: + case FileStatus::MISCELLANEOUS: + return true; + case FileStatus::OLD_VERSION: + case FileStatus::REMOVED: + case FileStatus::ARCHIVED: + case FileStatus::ARCHIVED_HIDDEN: + return false; + default: + return false; + } + } + public: static APILimits defaultAPILimits(); static APILimits parseLimits(const QNetworkReply* reply); -- cgit v1.3.1