From 9435249694eca94cef20040ae37a103b22280f5f Mon Sep 17 00:00:00 2001 From: StackZ <47382115+SuperSaiyajinStackZ@users.noreply.github.com> Date: Sat, 20 Jun 2020 23:30:51 +0200 Subject: [PATCH] Switch over to `last_updated`. --- source/utils/store.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/source/utils/store.cpp b/source/utils/store.cpp index 10bb5ee..12ad205 100644 --- a/source/utils/store.cpp +++ b/source/utils/store.cpp @@ -25,7 +25,6 @@ */ #include "store.hpp" -#include #include Store::Store(nlohmann::json &JS, std::string JSONName) { @@ -86,18 +85,8 @@ bool Store::updateAvailable(int index) { // Here we write that to our file. void Store::writeToFile(int index) { - std::string timeString; - - time_t rawtime; - struct tm * ptm; - time (&rawtime); - ptm = gmtime (&rawtime); - - timeString = std::to_string(ptm->tm_year + 1900) + "-" + std::to_string(ptm->tm_mon + 1) + "-" + std::to_string(ptm->tm_mday) + " at " + std::to_string(ptm->tm_hour) + ":" - + std::to_string(ptm->tm_min) + " (UTC)"; - FILE *file = fopen("sdmc:/3ds/Universal-Updater/updates.json", "w"); - this->updateJSON[this->updateFile][this->sortedStore[index].title] = timeString; + this->updateJSON[this->updateFile][this->sortedStore[index].title] = this->sortedStore[index].last_updated; fwrite(this->updateJSON.dump(1, '\t').c_str(), 1, this->updateJSON.dump(1, '\t').size(), file); fclose(file);