Fix TypeError when viewCount is not set

Fixes #190
This commit is contained in:
tdorsey 2017-09-28 06:43:49 -04:00 committed by GitHub
parent 874281828a
commit e0a213c5e4

View file

@ -44,8 +44,11 @@ class Video(PlexPartialObject):
@property @property
def isWatched(self): def isWatched(self):
""" Returns True if this video is watched. """ """ Returns True if this video is watched. """
return bool(self.viewCount > 0) if not self.viewCount:
return False
else:
return bool(self.viewCount > 0)
@property @property
def thumbUrl(self): def thumbUrl(self):
""" Return url to for the thumbnail image. """ """ Return url to for the thumbnail image. """