music box fixes
This commit is contained in:
@@ -503,10 +503,10 @@ body {
|
||||
|
||||
function renderMusicState(s) {
|
||||
if (!npLine) ensureNowPlayingLine();
|
||||
if (lastTrackIndex !== null && s.index !== lastTrackIndex) {
|
||||
if (lastTrackFile !== null && s.file && s.file !== lastTrackFile) {
|
||||
logBeforeNp(`[audio] next: ${s.title || '?'}`);
|
||||
}
|
||||
lastTrackIndex = s.index;
|
||||
if (s.file) lastTrackFile = s.file;
|
||||
npLine.querySelector('.np-title').textContent = s.title || '—';
|
||||
npLine.querySelector('.np-time').textContent =
|
||||
`[${fmtClock(s.currentTime)} / ${fmtClock(s.duration)}]`;
|
||||
@@ -533,7 +533,8 @@ body {
|
||||
if (pendingState) renderMusicState(pendingState);
|
||||
}
|
||||
|
||||
let lastTrackIndex = null;
|
||||
// Dedupe by file URI — see music-box/index.html for the rationale.
|
||||
let lastTrackFile = null;
|
||||
async function connectMusic() {
|
||||
if (!window.__OBSWS) {
|
||||
logBeforeNp('[audio] vendor/obs-config.js missing — run scripts/setup.sh', 'term-dim');
|
||||
|
||||
Reference in New Issue
Block a user