summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorSilarn <jrim@rimpo.org>2019-02-05 16:53:54 -0600
committerSilarn <jrim@rimpo.org>2019-02-18 21:31:19 -0600
commitd86d2f704ab0eb91a9051fa818b5195f323467fa (patch)
tree9af499b51726fc323037e573be2d2f4e519dbc21 /src/mainwindow.cpp
parenta873c7be23f270ab1a929aaf72aa03182e0ddc2c (diff)
Implement staggered timeouts bases on age.
* < 1 mo = 2 hours * < 3 mo = 4 hours * < 6 mo = 6 hours * < 1 yr = 12 hours * > 1 yr = 24 hours
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index cdf363cc..ce476143 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -5550,7 +5550,7 @@ void MainWindow::nxmUpdatesAvailable(QString gameName, int modID, QVariant userD
requiresInfo = true;
}
- if (mod->getLastNexusQuery().addDays(1) <= QDateTime::currentDateTime())
+ if (mod->getLastNexusQuery().addDays(1) <= QDateTime::currentDateTimeUtc())
requiresInfo = true;
}
@@ -5577,7 +5577,7 @@ void MainWindow::nxmModInfoAvailable(QString gameName, int modID, QVariant userD
std::vector<ModInfo::Ptr> modsList = ModInfo::getByModID(gameNameReal, modID);
for (auto mod : modsList) {
QDateTime now = QDateTime::currentDateTimeUtc();
- QDateTime updateTarget = mod->getLastNexusUpdate().addSecs(3600);
+ QDateTime updateTarget = mod->getExpires();
if (now >= updateTarget) {
mod->setNewestVersion(result["version"].toString());
mod->setLastNexusUpdate(QDateTime::currentDateTimeUtc());
@@ -5594,6 +5594,7 @@ void MainWindow::nxmModInfoAvailable(QString gameName, int modID, QVariant userD
mod->setIsEndorsed(false);
}
mod->setLastNexusQuery(QDateTime::currentDateTimeUtc());
+ mod->setNexusLastModified(QDateTime::fromSecsSinceEpoch(result["updated_timestamp"].toInt()));
mod->saveMeta();
}
}