don't filter freebies/outlaws on profiles + fix ~sub/recent/all

This commit is contained in:
k00b 2024-08-18 16:43:19 -05:00
parent 3608d133d7
commit df7baf4d7c
1 changed files with 4 additions and 2 deletions

View File

@ -202,7 +202,10 @@ export const nsfwClause = showNsfw => showNsfw ? '' : HIDE_NSFW_CLAUSE
const subClause = (sub, num, table, me, showNsfw) => {
// Intentionally show nsfw posts (i.e. no nsfw clause) when viewing a specific nsfw sub
if (sub) { return `${table ? `"${table}".` : ''}"subName" = $${num}::CITEXT` }
if (sub) {
const tables = [...new Set(['Item', table])].map(t => `"${t}".`)
return `(${tables.map(t => `${t}"subName" = $${num}::CITEXT`).join(' OR ')})`
}
if (!me) { return HIDE_NSFW_CLAUSE }
@ -346,7 +349,6 @@ export default {
${whereClause(
`"${table}"."userId" = $3`,
activeOrMine(me),
await filterClause(me, models, type),
nsfwClause(showNsfw),
typeClause(type),
whenClause(when || 'forever', table))}