Changeset 0596945 in Klonkt for src/routes/posts.js


Ignore:
Timestamp:
06/28/2026 10:33:07 AM (2 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
515cf1a
Parents:
c6cdce6
Message:

fix(related): blur NSFW covers in the Related Posts section

The related-posts grid on a post page didn't blur sensitive covers. Now it selects nsfw +
content_warning and renders the same click-to-reveal veil as the feed/grid/Circle cards.

  • routes/posts.js — related-posts queries (hub + solo) select nsfw, content_warning
  • views/pages/post.ejs — nsfw-media + nsfw-veil on the related cover
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/routes/posts.js

    rc6cdce6 r0596945  
    946946  const candidates = isHub
    947947    ? db.prepare(`
    948         SELECT p.id, p.slug, p.title, p.cover_image_url, p.published_at, p.tags, s.slug AS site_slug
     948        SELECT p.id, p.slug, p.title, p.cover_image_url, p.published_at, p.tags, p.nsfw, p.content_warning, s.slug AS site_slug
    949949        FROM posts p JOIN sites s ON s.id = p.site_id
    950950        WHERE p.status = 'published' AND p.id != ?
     
    952952      `).all(post.id)
    953953    : db.prepare(`
    954         SELECT id, slug, title, cover_image_url, published_at, tags
     954        SELECT id, slug, title, cover_image_url, published_at, tags, nsfw, content_warning
    955955        FROM posts
    956956        WHERE site_id = ? AND status = 'published' AND id != ?
Note: See TracChangeset for help on using the changeset viewer.