This commit is contained in:
2026-08-13 21:38:51 +02:00
parent 22db479bc2
commit 82298681af
2 changed files with 10 additions and 13 deletions
+8 -2
View File
@@ -613,7 +613,13 @@ export default {
const tmp = { user, tag: isTitleSearch ? _decodedTag : tag, hall, mime, itemid: rawIdOrSlug, strict: strict, userHall: userHallObj || userHallSlug, userHallOwner };
const effMode = Number(mode ?? 0);
const modequery = computeBaseMode(mode, ratings, session);
const nsflId = parseInt(cfg.nsfl_tag_id, 10) || 3;
const itemModeQuery = session
? computeBaseMode(mode, ratings, session)
: (cfg.websrv.public_nsfw
? `not exists (select 1 from tags_assign where item_id = items.id and tag_id = ${nsflId})`
: `not exists (select 1 from tags_assign where item_id = items.id and tag_id in (2, ${nsflId}))`
);
let tagFilter = db``;
let titleFilter = db``;
@@ -659,7 +665,7 @@ export default {
: db`and coalesce(items.visibility, 0) = 0`);
return db`
${db.unsafe(modequery)}
${db.unsafe(itemModeQuery)}
and items.active = true
${visibilityFilter}
and (items.expires_at IS NULL OR items.expires_at > ${Math.floor(Date.now() / 1000)})