diff --git a/server/routes/dashboard.js b/server/routes/dashboard.js index 4131ab3..e999e83 100644 --- a/server/routes/dashboard.js +++ b/server/routes/dashboard.js @@ -1054,17 +1054,20 @@ router.get('/stream', requireAuth, async (req, res) => { // 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)}"`); + const source = sonarrQueue.data.records.includes(sonarrMatch) ? 'queue' : 'history'; + console.log(`[SSE] ✓ Sonarr ${source} 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)}"`); + const source = radarrQueue.data.records.includes(radarrMatch) ? 'queue' : 'history'; + console.log(`[SSE] ✓ Radarr ${source} 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)}"`); - // Show actual Sonarr titles to debug matching - const sonarrTitles = sonarrQueue.data.records.slice(0, 5).map(r => { - const fields = {title: r.title, sourceTitle: r.sourceTitle, seriesTitle: r.series?.title, episodeTitle: r.episode?.title}; - return JSON.stringify(fields).substring(0, 80); - }); - console.log(`[SSE] Sonarr fields: ${sonarrTitles.join(' | ')}`); + // Show counts + console.log(`[SSE] Queue: ${sonarrQueue.data.records.length}, History: ${sonarrHistory.data.records.length}`); + // Show history titles if there are any + if (sonarrHistory.data.records.length > 0) { + const histTitles = sonarrHistory.data.records.slice(0, 3).map(r => (r.title || r.sourceTitle || 'NO_TITLE').substring(0, 40)); + console.log(`[SSE] History titles: ${histTitles.join(' | ')}`); + } } } if (sonarrMatch && sonarrMatch.seriesId) {