From d164c179588c6e352515afeeac2b02a89d3059e4 Mon Sep 17 00:00:00 2001 From: AL <26797547+Al12rs@users.noreply.github.com> Date: Tue, 9 Jun 2020 15:53:26 +0200 Subject: Fix consecutive mod update checks checking some mods again.. by correctly setting the last nexus update timestamp on a missed case. --- src/mainwindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 5dcfea1d..a9921d76 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -5644,9 +5644,10 @@ void MainWindow::nxmModInfoAvailable(QString gameName, int modID, QVariant userD // with an older version than the main mod version. if (mod->getNexusFileStatus() != 3 && mod->getNexusFileStatus() != 5) { mod->setNewestVersion(result["version"].toString()); - mod->setLastNexusUpdate(QDateTime::currentDateTimeUtc()); foundUpdate = true; } + // update the LastNexusUpdate time in any case since we did perform the check. + mod->setLastNexusUpdate(QDateTime::currentDateTimeUtc()); } mod->setNexusDescription(result["description"].toString()); if ((mod->endorsedState() != ModInfo::ENDORSED_NEVER) && (result.contains("endorsement"))) { -- cgit v1.3.1 From a565472b829c209c6481b61ff5308bf7a76c69bf Mon Sep 17 00:00:00 2001 From: AL <26797547+Al12rs@users.noreply.github.com> Date: Tue, 9 Jun 2020 15:54:36 +0200 Subject: Mark mods with orphaned nexus ids as checked to avoid repeated requests. --- src/mainwindow.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index a9921d76..9777091a 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -5777,6 +5777,20 @@ void MainWindow::nxmRequestFailed(QString gameName, int modID, int, QVariant, in { if (error == QNetworkReply::ContentAccessDenied || error == QNetworkReply::ContentNotFoundError) { log::debug("{}", tr("Mod ID %1 no longer seems to be available on Nexus.").arg(modID)); + + // update last checked timestamp on orphaned mods as well to avoid repeating requests + QString gameNameReal; + for (IPluginGame* game : m_PluginContainer.plugins()) { + if (game->gameNexusName() == gameName) { + gameNameReal = game->gameShortName(); + break; + } + } + auto orphanedMods = ModInfo::getByModID(gameNameReal, modID); + for (auto mod : orphanedMods) { + mod->setLastNexusUpdate(QDateTime::currentDateTimeUtc()); + mod->setLastNexusQuery(QDateTime::currentDateTimeUtc()); + } } else { MessageDialog::showMessage(tr("Request to Nexus failed: %1").arg(errorString), this); } -- cgit v1.3.1