Skip to content

Conversation

@cscattaglia917
Copy link

The Plex API seems to return a string if the viewCount is 0 for some reason. Casting to int fixed the issue.

Full traceback:
Traceback (most recent call last): File "plex.py", line 42, in <module> unwatchedList = tv.get(show.title).unwatched() File "/usr/local/lib/python3.5/dist-packages/plexapi/video.py", line 158, in unwatched return self.episodes(watched=False) File "/usr/local/lib/python3.5/dist-packages/plexapi/video.py", line 148, in episodes return utils.listItems(self.server, leavesKey, watched=watched) File "/usr/local/lib/python3.5/dist-packages/plexapi/utils.py", line 235, in listItems if watched is False and elem.attrib.get('viewCount', 0) >= 1: continue TypeError: unorderable types: str() >= int()

Note: I'm a beginner to GIT workflow(& Python for that matter..) I am not sure on the proper procedure for merging this 'fix' into your repo.. I forked it, cloned it, made my change, pushed it, and now I am starting the Pull Request. Is that right?

… to call unwatched(). The Plex API seems to return a string if the viewCount is 0 for some reason. Casting to int fixed the issue
@BlinkyStitt
Copy link
Contributor

I opened a similar diff that fixes slightly more: #87

@pkkid
Copy link
Collaborator

pkkid commented Jan 3, 2017

@cscattaglia917, thanks for the fix. We snagged @wysenynja fix as it included both watched and unwatched.

@pkkid pkkid closed this Jan 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants