summaryrefslogtreecommitdiff
path: root/src/modinfo.cpp
diff options
context:
space:
mode:
authorSilarn <jrim@rimpo.org>2019-01-27 17:08:42 -0600
committerSilarn <jrim@rimpo.org>2019-02-18 21:28:04 -0600
commit4bea346b26f2e34120a42fdf2f1c5485ab93f5c9 (patch)
tree110d43c989ef068117298aeef929a2500de02075 /src/modinfo.cpp
parent7de78b6697b60ac20add32b5b9140b04da973be8 (diff)
Reworking update checks to use the file update info with a fallback
Diffstat (limited to 'src/modinfo.cpp')
-rw-r--r--src/modinfo.cpp41
1 files changed, 6 insertions, 35 deletions
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<int> &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<int> 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<QString, QSharedPointer<ModInfo>> 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;
}