Changeset 30271e6 in Klonkt for src/views


Ignore:
Timestamp:
06/25/2026 06:13:00 AM (3 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
6c3d805
Parents:
2923a95
Message:

fix(fediverse): player card only for playable (hosted) audio; scope embed strictly

A link-only track (external, media_id NULL) has no hosted audio, so it must not get
a Klonkt player card — and /embed?post= must not fall back to ALL site tracks (that
showed unrelated songs). New hasPlayableAudio() gates the player card + cover-
suppression on a real file-backed track; link-only audio keeps its cover. /embed?post
now scopes strictly to the post's tracks (no all-site fallback).

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/views/shell.ejs

    r2923a95 r30271e6  
    158158// inline player that streams via the gated /audio/stream (no downloadable file).
    159159const _postAudio = !!(typeof post !== 'undefined' && post
    160   && /\[\[(track|album|playlist):/i.test(post.content || post.content_html || '')
     160  && typeof postHasPlayableAudio !== 'undefined' && postHasPlayableAudio
    161161  && typeof premiumUnlocked !== 'undefined' && premiumUnlocked);
    162162const _embedUrl = _postAudio
Note: See TracChangeset for help on using the changeset viewer.