jfh
This commit is contained in:
@@ -31,7 +31,9 @@ export async function regenerateTagImage(tag, mode) {
|
||||
JOIN tags_assign ta ON ta.item_id = i.id
|
||||
JOIN tags t ON t.id = ta.tag_id
|
||||
${modeFilter}
|
||||
WHERE (t.tag = ${tag} OR t.normalized = ${tag}) AND i.active = true
|
||||
WHERE (t.tag = ${tag} OR t.normalized = ${tag})
|
||||
AND i.active = true
|
||||
AND COALESCE(i.visibility, 0) = 0
|
||||
ORDER BY RANDOM()
|
||||
LIMIT 3
|
||||
`;
|
||||
|
||||
@@ -35,6 +35,7 @@ export default (router, tpl) => {
|
||||
JOIN tags_assign ta ON t.id = ta.tag_id
|
||||
JOIN items ON items.id = ta.item_id
|
||||
WHERE items.active = true
|
||||
AND COALESCE(items.visibility, 0) = 0
|
||||
AND t.id NOT IN (1, 2)
|
||||
AND ${db.unsafe(modequery)}
|
||||
${restrictedFilter}
|
||||
@@ -58,6 +59,7 @@ export default (router, tpl) => {
|
||||
JOIN items ON items.id = ta.item_id
|
||||
WHERE t.normalized LIKE '%' || ${tag.normalized} || '%'
|
||||
AND items.active = true
|
||||
AND COALESCE(items.visibility, 0) = 0
|
||||
AND ${db.unsafe(modequery)}
|
||||
${restrictedFilter}
|
||||
${userExcludeFilter}
|
||||
|
||||
@@ -260,7 +260,7 @@ export default (router, tpl) => {
|
||||
FROM items i
|
||||
JOIN user_halls_assign uha ON uha.item_id = i.id
|
||||
${modeFilter}
|
||||
WHERE uha.hall_id = ${hall.id} AND i.active = true
|
||||
WHERE uha.hall_id = ${hall.id} AND i.active = true AND COALESCE(i.visibility, 0) = 0
|
||||
ORDER BY RANDOM()
|
||||
LIMIT 3
|
||||
`;
|
||||
|
||||
@@ -35,6 +35,7 @@ export default (router, tpl) => {
|
||||
JOIN tags_assign ta ON t.id = ta.tag_id
|
||||
JOIN items ON items.id = ta.item_id
|
||||
WHERE items.active = true
|
||||
AND COALESCE(items.visibility, 0) = 0
|
||||
AND t.id NOT IN (1, 2)
|
||||
AND ta.user_id = ${userId}
|
||||
AND ${db.unsafe(modequery)}
|
||||
@@ -59,6 +60,7 @@ export default (router, tpl) => {
|
||||
JOIN items ON items.id = ta.item_id
|
||||
WHERE t.normalized LIKE '%' || ${tag.normalized} || '%'
|
||||
AND items.active = true
|
||||
AND COALESCE(items.visibility, 0) = 0
|
||||
AND ta.user_id = ${userId}
|
||||
AND ${db.unsafe(modequery)}
|
||||
${restrictedFilter}
|
||||
|
||||
Reference in New Issue
Block a user