This commit is contained in:
@@ -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));
|
||||||
|
|||||||
@@ -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);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user