summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorAL <26797547+Al12rs@users.noreply.github.com>2020-06-09 15:54:36 +0200
committerAL <26797547+Al12rs@users.noreply.github.com>2020-06-09 15:54:36 +0200
commita565472b829c209c6481b61ff5308bf7a76c69bf (patch)
tree98a0c8277b43c5cd2ecac9c30b27f5232209a7b1 /src/mainwindow.cpp
parentd164c179588c6e352515afeeac2b02a89d3059e4 (diff)
Mark mods with orphaned nexus ids as checked to avoid repeated requests.
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp14
1 files changed, 14 insertions, 0 deletions
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<IPluginGame>()) {
+ 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);
}