Changeset 30271e6 in Klonkt for src/routes
- Timestamp:
- 06/25/2026 06:13:00 AM (3 months ago)
- Branches:
- main
- Children:
- 6c3d805
- Parents:
- 2923a95
- Location:
- src/routes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/routes/embed.js
r2923a95 r30271e6 45 45 for (const m of post.content.matchAll(/\[\[album:([^\]]+)\]\]/g)) for (const r of db.prepare('SELECT id FROM audio_tracks WHERE site_id = ? AND album = ? ORDER BY position').all(site.id, m[1].trim())) add(r.id); 46 46 for (const m of post.content.matchAll(/\[\[playlist:([A-Za-z0-9_-]+)\]\]/g)) for (const r of db.prepare('SELECT track_id FROM playlist_tracks WHERE playlist_id = ? ORDER BY position').all(m[1])) add(r.track_id); 47 if (ids.length) { 48 const byId = new Map(tracks.map((t) => [t.id, t])); 49 const scoped = ids.map((id) => byId.get(id)).filter(Boolean); 50 if (scoped.length) tracks = scoped; 51 } 47 // Strictly scope to this post's tracks — do NOT fall back to all-site 48 // tracks (that showed unrelated songs for a link-only-track post). 49 const byId = new Map(tracks.map((t) => [t.id, t])); 50 tracks = ids.map((id) => byId.get(id)).filter(Boolean); 52 51 } 53 52 } catch { /* fall back to the full site player */ } -
src/routes/posts.js
r2923a95 r30271e6 848 848 canManageSite, 849 849 siteAvatar, 850 postHasPlayableAudio: ActivityPubService.hasPlayableAudio(post.content || '', site.id), 850 851 pageTitle: post.title + ' - ' + site.title, 851 852 socialDescr: post.excerpt || '',
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)