From 7485ba8aa26c28f646b388da6ac9f40d516930a3 Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Fri, 6 Mar 2026 08:01:17 -0800 Subject: [PATCH] fix issue with tracking auto sync playlist node --- web_server.py | 4 +++- webui/static/script.js | 22 +++++++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/web_server.py b/web_server.py index 6121dd3d..06d7865f 100644 --- a/web_server.py +++ b/web_server.py @@ -462,10 +462,12 @@ def _register_automation_handlers(): if extra.get('discovered') and extra.get('matched_data'): # Use official discovered metadata md = extra['matched_data'] + album_raw = md.get('album', '') + album_obj = album_raw if isinstance(album_raw, dict) else {'name': album_raw or ''} tracks_json.append({ 'name': md.get('name', ''), 'artists': md.get('artists', [{'name': t.get('artist_name', '')}]), - 'album': md.get('album', ''), + 'album': album_obj, 'duration_ms': md.get('duration_ms', 0), 'id': md.get('id', ''), }) diff --git a/webui/static/script.js b/webui/static/script.js index c202393a..d60f1c3f 100644 --- a/webui/static/script.js +++ b/webui/static/script.js @@ -42385,11 +42385,12 @@ function updateAutomationProgressFromData(data) { } } - // Diff-append log lines + // Update log lines const logEl = panel.querySelector('.auto-progress-log'); const rendered = _autoProgressLogCounts[aid] || 0; const logLines = state.log || []; if (logLines.length > rendered) { + // Normal append — log is still growing for (let i = rendered; i < logLines.length; i++) { const line = logLines[i]; const div = document.createElement('div'); @@ -42399,6 +42400,25 @@ function updateAutomationProgressFromData(data) { } _autoProgressLogCounts[aid] = logLines.length; logEl.scrollTop = logEl.scrollHeight; + } else if (logLines.length === rendered && logLines.length >= 50) { + // Log buffer is full and rotating — replace last few lines + const children = logEl.children; + if (children.length > 0) { + const lastServerLine = logLines[logLines.length - 1]; + const lastDomLine = children[children.length - 1]; + if (lastServerLine && lastDomLine.textContent !== lastServerLine.text) { + // Content changed — full re-render + logEl.innerHTML = ''; + for (const line of logLines) { + const div = document.createElement('div'); + div.className = 'auto-log-line ' + (line.type || 'info'); + div.textContent = line.text; + logEl.appendChild(div); + } + _autoProgressLogCounts[aid] = logLines.length; + logEl.scrollTop = logEl.scrollHeight; + } + } } } }