Changeset 2306abd in Klonkt


Ignore:
Timestamp:
06/30/2026 01:47:28 PM (2 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
292734a
Parents:
5924bbf
Message:

fix(news): don't render raw Audio attachments when a Klonkt embed player is present

A federated Klonkt audio post carries both AS2 Audio attachments (so it plays inline in clients
that don't render the embed, like Mastodon) AND a Klonkt embed player. The News feed showed both
-> two bare <audio> players next to the embed player. Skip the raw <audio> in the feed when the
post has a Klonkt embed (embedHtml/embedUrl); plain remote audio (no embed) keeps a player. The
federated note is unchanged (Mastodon still receives the Audio attachments).

  • src/views/pages/news.ejs — gate the raw <audio> render on no embed

Co-Authored-By: Claude <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/views/pages/news.ejs

    r5924bbf r2306abd  
    123123          <% } %>
    124124          <% vids.forEach(function(m){ %><video class="tl-media-video" src="<%= m.url %>" controls preload="metadata" playsinline></video><% }); %>
    125           <% auds.forEach(function(m){ %><audio class="tl-media-audio" src="<%= m.url %>" controls preload="none"></audio><% }); %>
     125          <% /* A Klonkt audio post carries an embed player (embedHtml/embedUrl) that already
     126                covers these tracks, so don't ALSO render the raw Audio attachments as bare
     127                players here. Posts without a Klonkt embed (e.g. a plain remote audio) keep them. */ %>
     128          <% if (!p.embedHtml && !p.embedUrl) { auds.forEach(function(m){ %><audio class="tl-media-audio" src="<%= m.url %>" controls preload="none"></audio><% }); } %>
    126129          <% if (_nsfwVisual) { %><div class="nsfw-veil"><span class="nsfw-veil-label">🔞 <%= p.cw || t('post.nsfw_warning') %></span><span class="nsfw-veil-btn"><%= t('post.nsfw_show') %></span></div></div><% } %>
    127130
Note: See TracChangeset for help on using the changeset viewer.