debug(sse): Add detailed name matching logging
All checks were successful
Build and Push Docker Image / build (push) Successful in 29s
Licence Check / Licence compatibility and copyright header verification (push) Successful in 1m4s
CI / Security audit (push) Successful in 1m29s
CI / Tests & coverage (push) Successful in 1m49s

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.
This commit is contained in:
2026-05-19 21:50:05 +01:00
parent f295e1c90d
commit 42c3eebf18

View File

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