summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
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);
}