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);