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