Switch over to last_updated.

This commit is contained in:
StackZ
2020-06-20 23:30:51 +02:00
parent 34ade17556
commit 9435249694
+1 -12
View File
@@ -25,7 +25,6 @@
*/ */
#include "store.hpp" #include "store.hpp"
#include <time.h>
#include <unistd.h> #include <unistd.h>
Store::Store(nlohmann::json &JS, std::string JSONName) { Store::Store(nlohmann::json &JS, std::string JSONName) {
@@ -86,18 +85,8 @@ bool Store::updateAvailable(int index) {
// Here we write that to our file. // Here we write that to our file.
void Store::writeToFile(int index) { 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"); 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); fwrite(this->updateJSON.dump(1, '\t').c_str(), 1, this->updateJSON.dump(1, '\t').size(), file);
fclose(file); fclose(file);