Skip to content

Commit

Permalink
chore: forgot to remove some commented out code
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroquinc committed Jun 22, 2024
1 parent 46f362e commit 9984484
Showing 1 changed file with 2 additions and 50 deletions.
52 changes: 2 additions & 50 deletions api/trakt/models/rating.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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)
return media_classes.get(media_type, lambda _: None)(data)

0 comments on commit 9984484

Please sign in to comment.