From 42c3eebf18481bd6883a92adaf8732f053d3821c Mon Sep 17 00:00:00 2001 From: Gronod Date: Tue, 19 May 2026 21:50:05 +0100 Subject: [PATCH] debug(sse): Add detailed name matching logging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Shows exactly which SAB items match/don't match to Sonarr/Radarr: - ✓ Sonarr match: SAB name → Sonarr name - ✓ Radarr match: SAB name → Radarr name - ✗ No match: SAB name (with Sonarr queue count) This will help diagnose why Sonarr Activity Queue shows matches but Sofarr doesn't. --- server/routes/dashboard.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/server/routes/dashboard.js b/server/routes/dashboard.js index d045b34..9041af1 100644 --- a/server/routes/dashboard.js +++ b/server/routes/dashboard.js @@ -1017,6 +1017,21 @@ router.get('/stream', requireAuth, async (req, res) => { const rTitle = (r.title || r.sourceTitle || '').toLowerCase(); return rTitle && (rTitle.includes(nzbNameLower) || nzbNameLower.includes(rTitle)); }); + const radarrMatch = radarrQueue.data.records.find(r => { + const rTitle = (r.title || r.sourceTitle || '').toLowerCase(); + return rTitle && (rTitle.includes(nzbNameLower) || nzbNameLower.includes(rTitle)); + }); + // Debug first 5 items - show matches and non-matches + if (sabSlotsChecked <= 5) { + if (sonarrMatch) { + console.log(`[SSE] ✓ Sonarr match: SAB:"${nzbNameLower.substring(0, 50)}" → Sonarr:"${(sonarrMatch.title || sonarrMatch.sourceTitle || '').substring(0, 50)}"`); + } else if (radarrMatch) { + console.log(`[SSE] ✓ Radarr match: SAB:"${nzbNameLower.substring(0, 50)}" → Radarr:"${(radarrMatch.title || radarrMatch.sourceTitle || '').substring(0, 50)}"`); + } else { + console.log(`[SSE] ✗ No match for SAB: "${nzbNameLower.substring(0, 60)}"`); + console.log(`[SSE] Sonarr queue has ${sonarrQueue.data.records.length} items`); + } + } if (sonarrMatch && sonarrMatch.seriesId) { sabSlotsMatched++; const series = seriesMap.get(sonarrMatch.seriesId) || sonarrMatch.series; @@ -1034,11 +1049,9 @@ router.get('/stream', requireAuth, async (req, res) => { } } - const radarrMatch = radarrQueue.data.records.find(r => { - const rTitle = (r.title || r.sourceTitle || '').toLowerCase(); - return rTitle && (rTitle.includes(nzbNameLower) || nzbNameLower.includes(rTitle)); - }); + // Handle Radarr match (radarrMatch already declared above) if (radarrMatch && radarrMatch.movieId) { + sabSlotsMatched++; const movie = moviesMap.get(radarrMatch.movieId) || radarrMatch.movie; if (movie) { const allTags = extractAllTags(movie.tags, radarrTagMap);