aktueller Stand lol

This commit is contained in:
Flummi
2021-05-15 13:58:24 +02:00
parent 4f35261e66
commit 964391f384
12 changed files with 529 additions and 28 deletions

View File

@ -9,10 +9,12 @@ import tpl from "../tpl.mjs";
tpl.readdir("views");
//router.get(/^\/(audio\/?|image\/?|video\/?|user\/?)?(p\/\d+)?$/, async (req, res) => {
router.get(/^\/(audio\/?|image\/?|video\/?)?(p\/\d+)?$/, async (req, res) => {
try {
let mime = false;
let q = false;
//if(req.url.split[0] == "user")
if(['audio', 'image', 'video'].includes(req.url.split[0])) {
mime = req.url.split[0];
q = " where " + (mimes[mime] ? mimes[mime].map(_mime => `mime = "${_mime}"`).join(" or ") : null);
@ -89,6 +91,9 @@ router.get(/^\/((audio\/|video\/|image\/)?[0-9]+)$/, async (req, res) => {
const next = qnext[qnext.length - 1] ? qnext[qnext.length - 1].id : false;
const prev = qprev[0] ? qprev[0].id : false;
for(let t = 0; t < tags.length; t++)
tags[t].tag = tags[t].tag.replace(/[\u00A0-\u9999<>\&]/g, i => '&#'+i.charCodeAt(0)+';');
const data = {
user: {
name: query.username,