Skip to content

Commit

Permalink
Exclude NaN from section id value
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed Jul 9, 2024
1 parent 14386e7 commit f50d940
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion plextraktsync/plex/PlexLibraryItem.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit f50d940

Please sign in to comment.