python-plexapi
python-plexapi copied to clipboard
Plex online sources str prints nan as id
Describe the Bug
<Movie:nan:Silent-Rage>
The problem being that the ratingKey is hash not integer for those items: 5d7768532e80df001ebe18e7
Code Snippets
➜ git grep 'ratingKey = utils.cast'
plexapi/audio.py: self.ratingKey = utils.cast(int, data.attrib.get('ratingKey'))
plexapi/client.py: self.ratingKey = utils.cast(int, data.attrib.get('ratingKey'))
plexapi/collection.py: self.ratingKey = utils.cast(int, data.attrib.get('ratingKey'))
plexapi/photo.py: self.ratingKey = utils.cast(int, data.attrib.get('ratingKey'))
plexapi/photo.py: self.ratingKey = utils.cast(int, data.attrib.get('ratingKey'))
plexapi/playlist.py: self.ratingKey = utils.cast(int, data.attrib.get('ratingKey'))
plexapi/video.py: self.ratingKey = utils.cast(int, data.attrib.get('ratingKey'))
Expected Behavior
No response
Additional Context
Related Issues:
- https://github.com/pkkid/python-plexapi/issues/1067
Operating System and Version
Irrelevant
Plex Media Server Version
Irrelevant
Python Version
Irrelevant
PlexAPI Version
4.13.1
now fix would be to remove the cast, but then it would be a breaking change. so would need new API like "maybe cast", or add int_fallback=str argument?
The entire library needs to be refactored to support Plex's online metadata source. There are a lot more differences than just the ratingKey.