From 45528a9ee6701190dcc7c5358b2ea22365afcd60 Mon Sep 17 00:00:00 2001 From: Spoked Date: Sat, 26 Oct 2024 10:05:26 -0400 Subject: [PATCH] fix: overseerr outputting items without imdbid's --- src/program/content/overseerr.py | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/src/program/content/overseerr.py b/src/program/content/overseerr.py index 94f50f12..8a339b47 100644 --- a/src/program/content/overseerr.py +++ b/src/program/content/overseerr.py @@ -88,15 +88,26 @@ def get_media_requests(self) -> list[MediaItem]: if item.status == 2 and item.media.status == 3 ] - return [ - MediaItem({ - "imdb_id": self.get_imdb_id(item.media), - "requested_by": self.key, - "overseerr_id": item.media.id, - "requested_id": item.id - }) - for item in pending_items - ] + media_items = [] + for item in pending_items: + imdb_id = self.get_imdb_id(item.media) + if imdb_id: + media_items.append( + MediaItem({ + "imdb_id": imdb_id, + "requested_by": self.key, + "overseerr_id": item.media.id, + "requested_id": item.id + }) + ) + else: + if item.media.tmdbId: + logger.debug(f"Skipping {item.type} with TMDb ID {item.media.tmdbId} due to missing IMDb ID") + elif item.media.tvdbId: + logger.debug(f"Skipping {item.type} with TVDb ID {item.media.tvdbId} due to missing IMDb ID") + else: + logger.debug(f"Skipping {item.type} with Overseerr ID {item.media.id} due to missing IMDb ID") + return media_items def get_imdb_id(self, data) -> str: