diff options
| author | Jeremy Rimpo <jeremy.rimpo@servermonkey.com> | 2020-09-09 11:25:19 -0500 |
|---|---|---|
| committer | Jeremy Rimpo <jeremy.rimpo@servermonkey.com> | 2020-09-09 11:25:19 -0500 |
| commit | 81036b0149eebc9033fd0cc089c1d9237c39cf14 (patch) | |
| tree | 48d2c167dea2ed8b8a3274679464661ee55e3046 /src/modinfo.cpp | |
| parent | 504683776c51253fbd2b922a269b09177944d031 (diff) | |
Fixes for bulk update check
* Check game source for validity
* Display name of source when no updates found
Diffstat (limited to 'src/modinfo.cpp')
| -rw-r--r-- | src/modinfo.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
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>(); + IPluginGame* gamePlugin = qApp->property("managed_game").value<IPluginGame*>(); + 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<std::pair<QString, int>> organizedGames; for (auto mod : s_Collection) { |
