From f50d940e73f2a5eb01f0651eeecc0ee3e5bd19bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Wed, 10 Jul 2024 02:32:12 +0300 Subject: [PATCH] Exclude NaN from section id value --- plextraktsync/plex/PlexLibraryItem.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plextraktsync/plex/PlexLibraryItem.py b/plextraktsync/plex/PlexLibraryItem.py index b154c7a17d..78a7da2d67 100644 --- a/plextraktsync/plex/PlexLibraryItem.py +++ b/plextraktsync/plex/PlexLibraryItem.py @@ -37,7 +37,13 @@ def is_legacy_agent(self): def section_id(self): # Use __dict__ access to prevent reloads: # https://github.com/pkkid/python-plexapi/pull/1093 - return self.item.__dict__["librarySectionID"] + section_id = self.item.__dict__["librarySectionID"] + # For some odd reason (or bug) section id is NaN. + # Treat it as None instead + # This is same as math.isnan(section_id) + if section_id != section_id: + return None + return section_id @cached_property def is_discover(self):