From 81036b0149eebc9033fd0cc089c1d9237c39cf14 Mon Sep 17 00:00:00 2001 From: Jeremy Rimpo Date: Wed, 9 Sep 2020 11:25:19 -0500 Subject: Fixes for bulk update check * Check game source for validity * Display name of source when no updates found --- src/modinfo.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/modinfo.cpp') diff --git a/src/modinfo.cpp b/src/modinfo.cpp index 826aa5c9..19621345 100644 --- a/src/modinfo.cpp +++ b/src/modinfo.cpp @@ -312,6 +312,22 @@ bool ModInfo::checkAllForUpdate(PluginContainer *pluginContainer, QObject *recei } } + // Detect invalid source games + for (auto itr = games.begin(); itr != games.end(); ++itr) { + auto gamePlugins = pluginContainer->plugins(); + IPluginGame* gamePlugin = qApp->property("managed_game").value(); + for (auto plugin : gamePlugins) { + if (plugin != nullptr && plugin->gameShortName().compare(*itr, Qt::CaseInsensitive) == 0) { + gamePlugin = plugin; + break; + } + } + if (gamePlugin != nullptr && gamePlugin->gameNexusName().isEmpty()) { + log::warn("The update check has found a mod with a Nexus ID and source game of {}, but this game is not a valid Nexus source.", gamePlugin->gameName()); + itr = games.erase(itr); + } + } + if (latest < QDateTime::currentDateTimeUtc().addMonths(-1)) { std::set> organizedGames; for (auto mod : s_Collection) { -- cgit v1.3.1