Changeset f2eacca in Klonkt for src/routes/admin-audio.js
- Timestamp:
- 06/30/2026 01:50:00 AM (2 months ago)
- Branches:
- main
- Children:
- 084d1c0
- Parents:
- 80797d7
- File:
-
- 1 edited
-
src/routes/admin-audio.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/routes/admin-audio.js
r80797d7 rf2eacca 96 96 const rows = db.prepare(` 97 97 SELECT t.id, t.title, t.artist, t.album, t.duration, t.cover_url, 98 t.position, t.created_at, t.downloadable, m.filename, m.size, m.mime_type98 t.position, t.created_at, t.downloadable, t.fedi_open, m.filename, m.size, m.mime_type 99 99 FROM audio_tracks t 100 100 LEFT JOIN media m ON m.id = t.media_id … … 288 288 }); 289 289 290 // Federate-the-file (fedi_open) per track on/off. When on, this track's audio file is shared 291 // as a real AS2 Audio attachment + served ungated → it plays inline in EVERY fediverse client 292 // (incl. the Mastodon apps), but the file is downloadable. Off (default) = gated, web-player only. 293 router.post('/:id/fedi-open', requireGod, (req, res) => { 294 const site = res.locals.site; 295 if (!site) return res.status(404).send('Site required'); 296 const row = db.prepare('SELECT fedi_open FROM audio_tracks WHERE id = ? AND site_id = ?').get(req.params.id, site.id); 297 if (row) { 298 db.prepare('UPDATE audio_tracks SET fedi_open = ? WHERE id = ? AND site_id = ?') 299 .run(row.fedi_open ? 0 : 1, req.params.id, site.id); 300 } 301 res.redirect('/admin/audio'); 302 }); 303 290 304 router.post('/:id/delete', requireGod, (req, res) => { 291 305 const site = res.locals.site;
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)