Changeset f2eacca in Klonkt for src/views/pages/admin-audio.ejs


Ignore:
Timestamp:
06/30/2026 01:50:00 AM (2 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
084d1c0
Parents:
80797d7
Message:

feat(music): per-track "share on the fediverse" — federate the file as a native AS2 Audio attachment

A per-track opt-in (default off) so an OPEN track's audio file is federated as a real AS2 Audio
attachment and served ungated → it plays inline in EVERY fediverse client, incl. the official
Mastodon apps (which only play native media, not external player cards). Gated tracks (default)
keep the file hidden + web-player-only. This is the spec-canonical way to federate audio; the
gated path stays the deliberate anti-steal choice.

  • src/config/database.js — audio_tracks.fedi_open column (default 0)
  • src/routes/audio.js — /audio/stream serves fedi_open tracks ungated so remote servers can fetch them
  • src/services/ActivityPubService.js (buildNote) — fedi_open tracks → AS2 Audio attachments (the file URL)
  • src/routes/admin-audio.js — POST /:id/fedi-open toggle (god-only) + fedi_open in the track query
  • src/views/pages/admin-audio.ejs — per-track share toggle next to the download toggle
  • src/services/i18n.js — aaud.fedi_on/off labels (nl/en/de)

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/views/pages/admin-audio.ejs

    r80797d7 rf2eacca  
    8383        var _aaudDlOn     = t('aaud.dl_on');
    8484        var _aaudDlOff    = t('aaud.dl_off');
     85        var _aaudFediOn   = t('aaud.fedi_on');
     86        var _aaudFediOff  = t('aaud.fedi_off');
    8587        var _aaudDelete   = t('aaud.delete');
    8688        var _aaudCopy     = t('aaud.copy_click');
     
    121123                        style="<%= t.downloadable ? 'color:var(--accent,#6b8f71)' : 'opacity:.5' %>">⬇</button>
    122124              <% } %>
     125              <form action="/admin/audio/<%= t.id %>/fedi-open" method="post" class="ax-track-fedi" style="display:inline">
     126                <button type="submit" class="ax-icon-btn"
     127                        aria-label="<%= t.fedi_open ? _aaudFediOn : _aaudFediOff %>" title="<%= t.fedi_open ? _aaudFediOn : _aaudFediOff %>"
     128                        style="<%= t.fedi_open ? 'color:var(--accent,#6b8f71)' : 'opacity:.5' %>">🌐</button>
     129              </form>
    123130              <form action="/admin/audio/<%= t.id %>/delete" method="post" data-confirm="<%= _aaudDelConfirm %>" class="ax-track-delete">
    124131                <button type="submit" class="ax-icon-btn ax-icon-btn-danger" aria-label="<%= _aaudDelete %>" title="<%= _aaudDelete %>">🗑</button>
Note: See TracChangeset for help on using the changeset viewer.