diff options
| author | Silarn <jrim@rimpo.org> | 2019-05-21 01:41:12 -0500 |
|---|---|---|
| committer | Silarn <jrim@rimpo.org> | 2019-05-21 01:41:12 -0500 |
| commit | c2ed511ff0822e2003b0ec3fe574a2a9e6b9d592 (patch) | |
| tree | be57568146c9c3b203015452d1b4feae2ef59f83 /src/modinfo.cpp | |
| parent | 44f6d833a967e64dc45f995a24ba3d562efa3cd8 (diff) | |
With old mods, only queue the old ones in case of API overflow
Diffstat (limited to 'src/modinfo.cpp')
| -rw-r--r-- | src/modinfo.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/modinfo.cpp b/src/modinfo.cpp index c1974152..bc2979ef 100644 --- a/src/modinfo.cpp +++ b/src/modinfo.cpp @@ -313,19 +313,23 @@ bool ModInfo::checkAllForUpdate(PluginContainer *pluginContainer, QObject *recei if (latest < QDateTime::currentDateTimeUtc().addDays(-30)) { std::set<std::pair<QString, int>> organizedGames; for (auto mod : s_Collection) { - if (mod->canBeUpdated()) { + if (mod->canBeUpdated() && mod->getLastNexusUpdate() < QDateTime::currentDateTimeUtc().addDays(-30)) { organizedGames.insert(std::make_pair<QString, int>(mod->getGameName().toLower(), mod->getNexusID())); } } if (organizedGames.empty()) { - qWarning("All of your mods have been checked recently. We restrict update checks to help preserve your available API requests."); + qWarning() << tr("All of your mods have been checked recently. We restrict update checks to help preserve your available API requests."); updatesAvailable = false; + } else { + qInfo() << tr( + "You have mods that haven't been checked within 30 days using the new API. These mods must be checked before we can use the bulk update API. " + "This will consume significantly more API requests than usual. You will need to rerun the update check once complete in order to parse the remaining mods." + ); } - for (auto game : organizedGames) { + for (auto game : organizedGames) NexusInterface::instance(pluginContainer)->requestUpdates(game.second, receiver, QVariant(), game.first, QString()); - } } else if (earliest < QDateTime::currentDateTimeUtc().addDays(-30)) { for (auto gameName : games) NexusInterface::instance(pluginContainer)->requestUpdateInfo(gameName, NexusInterface::UpdatePeriod::MONTH, receiver, QVariant(true), QString()); |
