Change manual time formatting to dayjs time fomatting. #39
@ -80,7 +80,7 @@ import { Model, model, Schema } from 'mongoose';
|
|||||||
Object.values(x.dispatcherStats).reduce((acc, curr) => acc + curr.time, 0)
|
Object.values(x.dispatcherStats).reduce((acc, curr) => acc + curr.time, 0)
|
||||||
|
|
||||||
console.log('updated ' + x.steamName)
|
console.log('updated ' + x.steamName)
|
||||||
await MProfile.updateOne({ id: x.id }, { trainPoints: x.trainPoints, trainDistance: x.trainDistance })
|
await MProfile.updateOne({ id: x.id }, { trainPoints: x.trainPoints, trainDistance: x.trainDistance, dispatcherTime: x.dispatcherTime, trainTime: x.trainTime })
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,9 +15,9 @@ export class ProfilesRoute {
|
|||||||
app.get('/:id', async (req, res) => {
|
app.get('/:id', async (req, res) => {
|
||||||
if (!req.params.id) return res.redirect('/');
|
if (!req.params.id) return res.redirect('/');
|
||||||
const player = await MProfile.findOne({ steam: req.params.id });
|
const player = await MProfile.findOne({ steam: req.params.id });
|
||||||
if (!player) return res.render('profiles/private.ejs');
|
if (!player) return res.render('profiles/private.ejs', GitUtil.getData());
|
||||||
const blacklist = await MBlacklist.findOne({ steam: req.params.id! });
|
const blacklist = await MBlacklist.findOne({ steam: req.params.id! });
|
||||||
if (blacklist && blacklist.status) return res.render('profiles/private.ejs');
|
if (blacklist && blacklist.status) return res.render('profiles/private.ejs', GitUtil.getData());
|
||||||
const steam = await SteamUtil.getPlayer(player?.steam!);
|
const steam = await SteamUtil.getPlayer(player?.steam!);
|
||||||
const steamStats = await SteamUtil.getPlayerStats(player?.steam!);
|
const steamStats = await SteamUtil.getPlayerStats(player?.steam!);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user