whoopsie a fucky wuckie appeared xD

This commit is contained in:
2026-05-14 16:43:05 +02:00
parent 47eef70bdc
commit 3b37e1d3db
2 changed files with 6 additions and 5 deletions

View File

@@ -8,9 +8,10 @@
const usernameEl = document.querySelector("a#a_username");
return {
postid: +idLink.innerText,
// Prefer data-username (raw DB username) over innerText (may be a display name)
poster: (usernameEl?.dataset?.username || '').trim() || usernameEl?.innerText?.trim() || null,
authorId: usernameEl?.dataset?.authorId || null,
// data-username holds the raw DB username; data-author-id holds the user's numeric ID.
// Never fall back to innerText — it may be a display name or the literal string 'unknown'.
poster: (usernameEl?.dataset?.username || '').trim() || null,
authorId: (usernameEl?.dataset?.authorId || '').trim() || null,
tags: [...inner.querySelectorAll(".badge")].map(t => t.innerText.slice(0, -2))
};
};

View File

@@ -232,7 +232,7 @@ export default {
) as contribution
` : db`0 as contribution`}
from items
left join "user" author_u on author_u.user = items.username
left join "user" author_u on author_u."user" = items.username or author_u.login = items.username
left join user_options uo on uo.user_id = author_u.id
left join tags_assign on tags_assign.item_id = items.id
left join tags on tags.id = tags_assign.tag_id
@@ -434,7 +434,7 @@ export default {
from items
left join favorites on favorites.item_id = items.id
left join "user" fav_u on fav_u.id = favorites.user_id
left join "user" author_u on author_u.user = items.username
left join "user" author_u on author_u."user" = items.username or author_u.login = items.username
left join "user_options" uo on uo.user_id = author_u.id
${user_id ? db`left join user_video_views uvv on uvv.video_id = items.id and uvv.user_id = ${user_id}` : db``}
where