|
144 | 144 | color: var(--text); |
145 | 145 | font-weight: 600; |
146 | 146 | } |
| 147 | + .now-title-link { |
| 148 | + color: var(--accent); |
| 149 | + text-decoration: none; |
| 150 | + } |
| 151 | + .now-title-link:hover { |
| 152 | + text-decoration: underline; |
| 153 | + } |
147 | 154 |
|
148 | 155 | .controls { |
149 | 156 | display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; |
@@ -1601,6 +1608,14 @@ <h3 class="modal-section-title">OBS Metadata Export</h3> |
1601 | 1608 | const id = extractYouTubeIdFrom(entry.trackName, entry.relativePath); |
1602 | 1609 | return id ? `https://youtu.be/${id}` : null; |
1603 | 1610 | }; |
| 1611 | + const resolveYouTubeUrlFromTrack = (track) => { |
| 1612 | + if (!track) return null; |
| 1613 | + const relativePath = track.path && track.path.length > 0 ? track.path.join('/') : ''; |
| 1614 | + return resolveYouTubeUrl({ |
| 1615 | + trackName: track.displayName || track.name, |
| 1616 | + relativePath: relativePath |
| 1617 | + }); |
| 1618 | + }; |
1604 | 1619 |
|
1605 | 1620 | const isRewoundPercent = (percent) => typeof percent === 'number' && percent > REWIND_RATIO_THRESHOLD; |
1606 | 1621 | const describeHistoryStatus = (entry) => { |
@@ -2838,7 +2853,21 @@ <h3 class="modal-section-title">OBS Metadata Export</h3> |
2838 | 2853 | const tr = tracks[current]; |
2839 | 2854 | const details = recordPendingAnnouncement(tr, { skipReason }); |
2840 | 2855 | audio.src = tr.url; |
2841 | | - if (nowTitleEl) nowTitleEl.textContent = tr.displayName; |
| 2856 | + if (nowTitleEl) { |
| 2857 | + const youtubeUrl = resolveYouTubeUrlFromTrack(tr); |
| 2858 | + if (youtubeUrl) { |
| 2859 | + nowTitleEl.innerHTML = ''; |
| 2860 | + const link = document.createElement('a'); |
| 2861 | + link.className = 'now-title-link'; |
| 2862 | + link.href = youtubeUrl; |
| 2863 | + link.target = '_blank'; |
| 2864 | + link.rel = 'noopener'; |
| 2865 | + link.textContent = tr.displayName; |
| 2866 | + nowTitleEl.appendChild(link); |
| 2867 | + } else { |
| 2868 | + nowTitleEl.textContent = tr.displayName; |
| 2869 | + } |
| 2870 | + } |
2842 | 2871 | if (nowArtistEl) nowArtistEl.textContent = (details && details.artist) ? details.artist : '—'; |
2843 | 2872 | if (nowTrackNumberEl) nowTrackNumberEl.textContent = fmtTrackNumber(current); |
2844 | 2873 | const key = trackKey(tr); |
|
0 commit comments