From 70f9e6553d2b360e35ee3491522a5c55debd5ce7 Mon Sep 17 00:00:00 2001 From: Flummi Date: Wed, 25 May 2022 15:25:36 +0200 Subject: [PATCH] don't include the username when showing favs --- src/inc/routeinc/f0cklib.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/inc/routeinc/f0cklib.mjs b/src/inc/routeinc/f0cklib.mjs index c930ba2..faff73d 100644 --- a/src/inc/routeinc/f0cklib.mjs +++ b/src/inc/routeinc/f0cklib.mjs @@ -30,7 +30,7 @@ export default { and items.active = 'true' ${ tag ? db`and tags.normalized ilike '%' || slugify(${tag}) || '%'` : db`` } ${ o.fav ? db`and "user".user ilike ${'%'+user+'%'}` : db`` } - ${ user ? db`and items.username ilike ${'%'+user+'%'}` : db`` } + ${ !o.fav && user ? db`and items.username ilike ${'%'+user+'%'}` : db`` } ${ mime ? db`and items.mime ilike ${smime}` : db`` } ${ !o.session ? db`and items.id not in (select item_id from tags_assign where item_id = items.id and (${db.unsafe(globalfilter)}))` : db`` } group by items.id, tags.tag @@ -64,7 +64,7 @@ export default { and items.active = 'true' ${ tag ? db`and tags.normalized ilike '%' || slugify(${tag}) || '%'` : db`` } ${ o.fav ? db`and "user".user ilike ${'%'+user+'%'}` : db`` } - ${ user ? db`and items.username ilike ${'%'+user+'%'}` : db`` } + ${ !o.fav && user ? db`and items.username ilike ${'%'+user+'%'}` : db`` } ${ mime ? db`and items.mime ilike ${smime}` : db`` } ${ !o.session ? db`and items.id not in (select item_id from tags_assign where item_id = items.id and (${db.unsafe(globalfilter)}))` : db`` } group by items.id, tags.tag, ta.tag_id @@ -126,7 +126,7 @@ export default { and items.active = 'true' ${ tag ? db`and tags.normalized ilike '%' || slugify(${tag}) || '%'` : db`` } ${ o.fav ? db`and "user".user ilike ${'%'+user+'%'}` : db`` } - ${ user ? db`and items.username ilike ${'%'+user+'%'}` : db`` } + ${ !o.fav && user ? db`and items.username ilike ${'%'+user+'%'}` : db`` } ${ mime ? db`and items.mime ilike ${smime}` : db`` } ${ !o.session ? db`and items.id not in (select item_id from tags_assign where item_id = items.id and (${db.unsafe(globalfilter)}))` : db`` } group by items.id, tags.tag, ta.tag_id