1
0

feat: Last update
All checks were successful
Remote Deploy / deploy (push) Successful in 6s

This commit is contained in:
2025-10-21 19:35:45 +02:00
parent 0a0b9ab436
commit a942818247
2 changed files with 7 additions and 3 deletions

View File

@@ -166,6 +166,9 @@ export default async function parseThisShit(downloadedFilePath) {
finalIndex++; finalIndex++;
} }
const currentDate = new Date();
const formattedDate = currentDate.getHours().padStart(2, "0") + ":" + currentDate.getMinutes().padStart(2, "0");
const data = { const data = {
schedule: final, schedule: final,
props: upcomingSheets.map((str) => { props: upcomingSheets.map((str) => {
@@ -194,6 +197,9 @@ export default async function parseThisShit(downloadedFilePath) {
priprava: isPriprava, priprava: isPriprava,
}; };
}), }),
status: {
lastUpdated: formattedDate,
}
} }
fs.writeFileSync("db/current.json", JSON.stringify(data)); fs.writeFileSync("db/current.json", JSON.stringify(data));

View File

@@ -10,9 +10,7 @@ app.get('/', async (_, res) => {
const dataStr = await fs.readFile(path.join(process.cwd(), "db", "current.json"), "utf8"); const dataStr = await fs.readFile(path.join(process.cwd(), "db", "current.json"), "utf8");
const data = JSON.parse(dataStr); const data = JSON.parse(dataStr);
data["status"] = { data["status"]["currentUpdateSchedule"] = getCurrentInterval();
currentUpdateSchedule: getCurrentInterval(),
};
res.json(data); res.json(data);
}); });