From 4bea346b26f2e34120a42fdf2f1c5485ab93f5c9 Mon Sep 17 00:00:00 2001 From: Silarn Date: Sun, 27 Jan 2019 17:08:42 -0600 Subject: Reworking update checks to use the file update info with a fallback --- src/modinfo.cpp | 43 +++++++------------------------------------ 1 file changed, 7 insertions(+), 36 deletions(-) (limited to 'src/modinfo.cpp') diff --git a/src/modinfo.cpp b/src/modinfo.cpp index 905341b0..e7b7657b 100644 --- a/src/modinfo.cpp +++ b/src/modinfo.cpp @@ -285,30 +285,15 @@ ModInfo::ModInfo(PluginContainer *pluginContainer) } -void ModInfo::checkChunkForUpdate(PluginContainer *pluginContainer, const std::vector &modIDs, QObject *receiver, QString gameName) -{ - if (modIDs.size() != 0) { - NexusInterface::instance(pluginContainer)->requestUpdates(modIDs, receiver, QVariant(), gameName, QString()); - } -} - - int ModInfo::checkAllForUpdate(PluginContainer *pluginContainer, QObject *receiver) { - // technically this should be 255 but those requests can take nexus fairly long, produce - // large output and may have been the cause of issue #1166 - static const int chunkSize = 64; - int result = 0; - std::vector modIDs; - - // Normally this would be the managed game but MO2 is only uploaded to the Skyrim SE site right now - IPluginGame const *game = pluginContainer->managedGame("Skyrim Special Edition"); - if (game && game->nexusModOrganizerID()) { - modIDs.push_back(game->nexusModOrganizerID()); - checkChunkForUpdate(pluginContainer, modIDs, receiver, game->gameShortName()); - modIDs.clear(); - } + + // MO2 endorsement status is no longer available via this method - an alternative must be found + //IPluginGame const *game = pluginContainer->managedGame("Skyrim Special Edition"); + //if (game && game->nexusModOrganizerID()) { + // NexusInterface::instance(pluginContainer)->requestUpdates(game->nexusModOrganizerID(), receiver, QVariant(), game->gameShortName(), QString()); + //} std::multimap> organizedGames; for (auto mod : s_Collection) { @@ -317,24 +302,10 @@ int ModInfo::checkAllForUpdate(PluginContainer *pluginContainer, QObject *receiv } } - QString currentGame = ""; for (auto game : organizedGames) { - if (currentGame != game.first) { - if (currentGame != "") { - checkChunkForUpdate(pluginContainer, modIDs, receiver, currentGame); - modIDs.clear(); - } - currentGame = game.first; - } - modIDs.push_back(game.second->getNexusID()); - if (modIDs.size() >= chunkSize) { - checkChunkForUpdate(pluginContainer, modIDs, receiver, currentGame); - modIDs.clear(); - } + NexusInterface::instance(pluginContainer)->requestUpdates(game.second->getNexusID(), receiver, QVariant(), game.first, QString()); } - checkChunkForUpdate(pluginContainer, modIDs, receiver, currentGame); - return result; } -- cgit v1.3.1