forked from f0ck/f0ckv2
uga aga
This commit is contained in:
@ -4,20 +4,22 @@ import lib from "../../inc/lib.mjs";
|
||||
import f0cklib from "../routeinc/f0cklib.mjs";
|
||||
|
||||
export default (router, tpl) => {
|
||||
router.get(/^\/tags$/,lib.loggedin, async (req, res) => {
|
||||
router.get(/^\/tags$/, async (req, res) => {
|
||||
|
||||
const phrase = cfg.websrv.phrases[~~(Math.random() * cfg.websrv.phrases.length)];
|
||||
|
||||
const nsfp = cfg.nsfp.map(n => `${n}`);
|
||||
|
||||
const toptags = await db`
|
||||
SELECT t.id, t.tag, COUNT(DISTINCT ta.item_id) AS total_items
|
||||
FROM tags t
|
||||
LEFT JOIN tags_assign ta ON t.id = ta.tag_id
|
||||
WHERE t.id not in (${db.unsafe(nsfp)})
|
||||
GROUP BY t.id, t.tag
|
||||
ORDER BY total_items DESC
|
||||
LIMIT 500
|
||||
;
|
||||
`;
|
||||
|
||||
res.reply({
|
||||
body: tpl.render('tags', {
|
||||
toptags,
|
||||
|
@ -110,7 +110,7 @@ process.on('unhandledRejection', err => {
|
||||
db({
|
||||
user_id: +user[0].id,
|
||||
mode: user[0].mode ?? 0,
|
||||
theme: req.session.theme ?? 'f0ck',
|
||||
theme: req.session.theme ?? 'atmos',
|
||||
fullscreen: req.session.fullscreen || 0
|
||||
}, 'user_id', 'mode', 'theme', 'fullscreen')
|
||||
}
|
||||
|
Reference in New Issue
Block a user