diff --git a/api/trakt/models/rating.py b/api/trakt/models/rating.py index 8c47f2f..98c8fd2 100644 --- a/api/trakt/models/rating.py +++ b/api/trakt/models/rating.py @@ -81,7 +81,7 @@ def __init__(self, data): class Show: def __init__(self, data): - self.title = data['show']['title'] + self.show_title = data['show']['title'] self.year = data['show']['year'] self.slug = data['show']['ids']['slug'] self.trakt_id = data['show']['ids']['trakt'] diff --git a/src/trakt/functions.py b/src/trakt/functions.py index 17f6207..b6f35bb 100644 --- a/src/trakt/functions.py +++ b/src/trakt/functions.py @@ -12,12 +12,6 @@ async def process_ratings(ratings_channel, username): ratings = sorted(user.get_ratings(start_time=then, end_time=now), key=lambda rating: rating.date) async def process_rating(rating): - description_formats = { - 'show': f"{username} rated this {rating.type} {rating.rated} :star:", - 'season': f"{username} rated this {rating.type} {rating.rated} :star:", - 'episode': f"{username} rated this {rating.type} {rating.rated} :star:", - 'movie': f"{username} rated this {rating.type} {rating.rated} :star:" - } author_formats = { 'show': "A show has been rated on Trakt", 'season': "A season has been rated on Trakt", @@ -30,7 +24,7 @@ async def process_rating(rating): 'episode': f"{rating.show_title} - S{rating.season_id}E{rating.episode_id}", 'movie': f"{rating.title} ({rating.year})" } - description = description_formats[rating.type] + description = f"{username} rated this {rating.type} {rating.rated} :star:" author = author_formats[rating.type] title = title_formats[rating.type] embed_builder = EmbedBuilder(title=title, description=description, color=0xFF0000)