Add logging for filtered event types and missing series/movie objects
Build and Push Docker Image / build (push) Successful in 39s
Licence Check / Licence compatibility and copyright header verification (push) Successful in 1m16s
CI / Security audit (push) Successful in 1m24s
CI / Tests & coverage (push) Successful in 1m43s

This commit is contained in:
2026-05-21 01:02:57 +01:00
parent 4ff462b7f4
commit 830dea3d6b
+16 -3
View File
@@ -266,10 +266,16 @@ router.get('/recent', requireAuth, async (req, res) => {
for (const record of sonarrHistory) { for (const record of sonarrHistory) {
try { try {
const outcome = classifySonarrEvent(record.eventType); const outcome = classifySonarrEvent(record.eventType);
if (outcome === 'other') continue; if (outcome === 'other') {
console.log(`[History] Filtered out Sonarr record with eventType: ${record.eventType}, sourceTitle: ${record.sourceTitle || record.title || 'unknown'}`);
continue;
}
const series = record.series; const series = record.series;
if (!series) continue; if (!series) {
console.log(`[History] Filtered out Sonarr record with no series object - eventType: ${record.eventType}, sourceTitle: ${record.sourceTitle || record.title || 'unknown'}`);
continue;
}
const rawTagIds = series.tags || []; const rawTagIds = series.tags || [];
const allTags = extractAllTags(series.tags, sonarrTagMap); const allTags = extractAllTags(series.tags, sonarrTagMap);
@@ -323,9 +329,16 @@ router.get('/recent', requireAuth, async (req, res) => {
for (const record of radarrHistory) { for (const record of radarrHistory) {
try { try {
const outcome = classifyRadarrEvent(record.eventType); const outcome = classifyRadarrEvent(record.eventType);
if (outcome === 'other') continue; if (outcome === 'other') {
console.log(`[History] Filtered out Radarr record with eventType: ${record.eventType}, sourceTitle: ${record.sourceTitle || record.title || 'unknown'}`);
continue;
}
const movie = record.movie; const movie = record.movie;
if (!movie) {
console.log(`[History] Filtered out Radarr record with no movie object - eventType: ${record.eventType}, sourceTitle: ${record.sourceTitle || record.title || 'unknown'}`);
continue;
}
const rawTagIds = movie.tags || []; const rawTagIds = movie.tags || [];
const allTags = extractAllTags(movie.tags, radarrTagMap); const allTags = extractAllTags(movie.tags, radarrTagMap);
const matchedUserTag = extractUserTag(movie.tags, radarrTagMap, username); const matchedUserTag = extractUserTag(movie.tags, radarrTagMap, username);