debug(sse): Add SAB matching stats to trace filtering
All checks were successful
Build and Push Docker Image / build (push) Successful in 36s
Licence Check / Licence compatibility and copyright header verification (push) Successful in 49s
CI / Security audit (push) Successful in 1m18s
CI / Tests & coverage (push) Successful in 1m27s

Shows how many SAB items were checked vs how many matched to Sonarr/Radarr.
This will help diagnose why only ~10 of 60 SAB items are appearing.
This commit is contained in:
2026-05-19 21:47:12 +01:00
parent c5e8281440
commit f295e1c90d

View File

@@ -1003,10 +1003,13 @@ router.get('/stream', requireAuth, async (req, res) => {
}
// SABnzbd queue
let sabSlotsChecked = 0;
let sabSlotsMatched = 0;
if (sabnzbdQueue.data.queue && sabnzbdQueue.data.queue.slots) {
for (const slot of sabnzbdQueue.data.queue.slots) {
const nzbName = slot.filename || slot.nzbname;
if (!nzbName) continue;
sabSlotsChecked++;
const slotState = getSlotStatusAndSpeed(slot);
const nzbNameLower = nzbName.toLowerCase();
@@ -1015,6 +1018,7 @@ router.get('/stream', requireAuth, async (req, res) => {
return rTitle && (rTitle.includes(nzbNameLower) || nzbNameLower.includes(rTitle));
});
if (sonarrMatch && sonarrMatch.seriesId) {
sabSlotsMatched++;
const series = seriesMap.get(sonarrMatch.seriesId) || sonarrMatch.series;
if (series) {
const allTags = extractAllTags(series.tags, sonarrTagMap);
@@ -1167,6 +1171,7 @@ router.get('/stream', requireAuth, async (req, res) => {
}
// Write SSE event
console.log(`[SSE] SAB matching: ${sabSlotsChecked} checked, ${sabSlotsMatched} matched to Sonarr/Radarr`);
console.log(`[SSE] Sending ${userDownloads.length} downloads for ${user.name}`);
if (userDownloads.length > 0) {
console.log(`[SSE] Download titles: ${userDownloads.map(d => d.title).join(', ')}`);