2024-09-19 05:44:24 -04:00
|
|
|
import Route from "../route.js";
|
2024-09-22 03:49:36 -04:00
|
|
|
import comment from "./comment.js";
|
2024-09-19 05:44:24 -04:00
|
|
|
import initDb from "../db.js";
|
|
|
|
|
|
|
|
let db = await initDb();
|
|
|
|
|
2024-09-22 03:49:36 -04:00
|
|
|
let main = new Route([comment], async function (req, res, input) {
|
2024-09-19 05:44:24 -04:00
|
|
|
let videoData = await db.all('SELECT * FROM video WHERE id = ?', [
|
|
|
|
req.query.id
|
|
|
|
]);
|
2024-10-24 22:41:21 -04:00
|
|
|
if (videoData.length == 0) return;
|
2024-09-19 05:44:24 -04:00
|
|
|
videoData = videoData[0];
|
|
|
|
return res.render('player', {
|
2024-09-22 03:49:36 -04:00
|
|
|
...input,
|
2024-10-30 20:37:20 -04:00
|
|
|
videoData,
|
|
|
|
ogType: 'video'
|
2024-09-19 05:44:24 -04:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
export default main;
|