Changeset 183875b in Klonkt for src/routes/posts.js


Ignore:
Timestamp:
06/20/2026 05:23:08 AM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
d727e92
Parents:
459acd9
Message:

feat(audio): per-track "open in" Spotify/YouTube/SoundCloud links

New per-track fields link_spotify/link_youtube/link_soundcloud (audio_tracks),
editable in the track editor (https + correct host validated). Shown as small
brand icons per track row in standalone track embeds, albums and playlists —
click opens the track on that service (new tab). buster audio.css?v=8.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/routes/posts.js

    r459acd9 r183875b  
    529529      const placeholders = trackIds.map(() => '?').join(',');
    530530      const rows = db.prepare(`
    531         SELECT t.id, t.title, t.artist, t.cover_url, t.credit, t.license, m.filename
     531        SELECT t.id, t.title, t.artist, t.cover_url, t.credit, t.license,
     532               t.link_spotify, t.link_youtube, t.link_soundcloud, m.filename
    532533        FROM audio_tracks t LEFT JOIN media m ON m.id = t.media_id
    533534        WHERE t.site_id = ? AND t.id IN (${placeholders})
     
    544545          credit: r.credit || '',
    545546          license: r.license || '',
     547          link_spotify: r.link_spotify || '',
     548          link_youtube: r.link_youtube || '',
     549          link_soundcloud: r.link_soundcloud || '',
    546550          url: audioUrl(r.filename),
    547551        };
     
    554558      const placeholders = albumNames.map(() => '?').join(',');
    555559      const albumRows = db.prepare(`
    556         SELECT t.id, t.title, t.artist, t.album, t.cover_url, t.position, m.filename
     560        SELECT t.id, t.title, t.artist, t.album, t.cover_url, t.position,
     561               t.link_spotify, t.link_youtube, t.link_soundcloud, m.filename
    557562        FROM audio_tracks t LEFT JOIN media m ON m.id = t.media_id
    558563        WHERE t.site_id = ? AND t.album IN (${placeholders})
     
    569574          artist: r.artist || '',
    570575          cover: r.cover_url || '',
     576          link_spotify: r.link_spotify || '',
     577          link_youtube: r.link_youtube || '',
     578          link_soundcloud: r.link_soundcloud || '',
    571579        });
    572580      }
Note: See TracChangeset for help on using the changeset viewer.