diff --git a/api/trakt/models/rating.py b/api/trakt/models/rating.py index f1b5636..64807a4 100644 --- a/api/trakt/models/rating.py +++ b/api/trakt/models/rating.py @@ -38,7 +38,7 @@ def set_media_attributes(self, media): self.episode_id = media.episode_id if isinstance(media, Show): - self.show_title = media.show_title + self.show_title = media.title @classmethod def from_json(cls, data): @@ -47,52 +47,4 @@ def from_json(cls, data): def create_media(data): media_classes = {'movie': Movie, 'episode': Episode, 'season': Season, 'show': Show} media_type = data['type'] - return media_classes.get(media_type, lambda _: None)(data) - -# class Movie: -# def __init__(self, data): -# self.title = data['movie']['title'] -# self.year = data['movie']['year'] -# self.slug = data['movie']['ids']['slug'] -# self.trakt_id = data['movie']['ids']['trakt'] -# self.imdb_id = data['movie']['ids']['imdb'] -# self.tmdb_id = data['movie']['ids']['tmdb'] -# self.poster = TMDb.movie_poster_path(self.tmdb_id) - -# class Episode: -# def __init__(self, data): -# self.title = data['episode']['title'] -# self.show_title = data['show']['title'] -# self.season_id = "{:02}".format(data['episode']['season']) # Format as two-digit number -# self.episode_id = "{:02}".format(data['episode']['number']) # Format as two-digit number -# self.year = data['show']['year'] -# self.slug = data['show']['ids']['slug'] -# self.trakt_id = data['show']['ids']['trakt'] -# self.imdb_id = data['show']['ids']['imdb'] -# self.tmdb_id = data['show']['ids']['tmdb'] -# self.tvdb_id = data['show']['ids']['tvdb'] -# self.poster = TMDb.show_poster_path(self.tvdb_id) - -# class Season: -# def __init__(self, data): -# self.title = data['show']['title'] -# self.show_title = data['show']['title'] -# self.season_id = "{:02}".format(data['season']['number']) # Format as two-digit number -# self.year = data['show']['year'] -# self.slug = data['show']['ids']['slug'] -# self.trakt_id = data['show']['ids']['trakt'] -# self.imdb_id = data['show']['ids']['imdb'] -# self.tmdb_id = data['show']['ids']['tmdb'] -# self.tvdb_id = data['show']['ids']['tvdb'] -# self.poster = TMDb.show_poster_path(self.tvdb_id) - -# class Show: -# def __init__(self, data): -# self.show_title = data['show']['title'] -# self.year = data['show']['year'] -# self.slug = data['show']['ids']['slug'] -# self.trakt_id = data['show']['ids']['trakt'] -# self.imdb_id = data['show']['ids']['imdb'] -# self.tmdb_id = data['show']['ids']['tmdb'] -# self.tvdb_id = data['show']['ids']['tvdb'] -# self.poster = TMDb.show_poster_path(self.tvdb_id) \ No newline at end of file + return media_classes.get(media_type, lambda _: None)(data) \ No newline at end of file