Add logging for filtered event types and missing series/movie objects
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user