|
|
|
@ -39,13 +39,22 @@ class OMDbObj:
|
|
|
|
|
self.imdb_rating = _parse("imdbRating", is_float=True)
|
|
|
|
|
self.imdb_votes = _parse("imdbVotes", is_int=True, replace=",")
|
|
|
|
|
self.metacritic_rating = _parse("Metascore", is_int=True)
|
|
|
|
|
self.rotten_tomatoes = None
|
|
|
|
|
try:
|
|
|
|
|
for rating in data["Ratings"]:
|
|
|
|
|
if rating["Source"] == "Rotten Tomatoes":
|
|
|
|
|
data["tempRT"] = rating["Value"] # This is a hack to allow _parse to work without changes
|
|
|
|
|
self.rotten_tomatoes = _parse("tempRT", is_int=True, replace="%")
|
|
|
|
|
break
|
|
|
|
|
except KeyError:
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
self.imdb_id = _parse("imdbID")
|
|
|
|
|
self.type = _parse("Type")
|
|
|
|
|
self.series_id = _parse("seriesID")
|
|
|
|
|
self.season_num = _parse("Season", is_int=True)
|
|
|
|
|
self.episode_num = _parse("Episode", is_int=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class OMDb:
|
|
|
|
|
def __init__(self, requests, cache, params):
|
|
|
|
|
self.requests = requests
|
|
|
|
|