Compare commits

...

3 Commits

Author SHA1 Message Date
k00b 555601c7de no bios in random 2024-08-20 21:12:39 -05:00
k00b 85e91ede47 show only active items with comments on random 2024-08-20 21:09:52 -05:00
k00b accf5212b2 fix ~jobs 2024-08-20 20:50:04 -05:00
1 changed files with 5 additions and 1 deletions

View File

@ -202,7 +202,7 @@ const HIDE_NSFW_CLAUSE = '("Sub"."nsfw" = FALSE OR "Sub"."nsfw" IS NULL)'
export const nsfwClause = showNsfw => showNsfw ? '' : HIDE_NSFW_CLAUSE
const subClause = (sub, num, table, me, showNsfw) => {
const subClause = (sub, num, table = 'Item', me, showNsfw) => {
// Intentionally show nsfw posts (i.e. no nsfw clause) when viewing a specific nsfw sub
if (sub) {
const tables = [...new Set(['Item', table])].map(t => `"${t}".`)
@ -412,10 +412,14 @@ export default {
${whereClause(
'"Item"."deletedAt" IS NULL',
'"Item"."weightedVotes" - "Item"."weightedDownVotes" > 2',
'"Item"."ncomments" > 0',
'"Item"."parentId" IS NULL',
'"Item".bio = false',
type === 'posts' && '"Item"."subName" IS NOT NULL',
subClause(sub, 3, subClauseTable(type), me, showNsfw),
typeClause(type),
await filterClause(me, models, type),
activeOrMine(me),
muteClause(me))}
${orderByClause('random', me, models, type)}
OFFSET $1