Remove unnecessary request to trakt api to fetch show id
MODIFY
plextraktsync/media.py
plextraktsync/media.py
@@ -78,7 +78,10 @@ def watched_on_trakt(self):
return watched.get_completed(self.show_trakt_id, self.season_number, self.episode_number)
def mark_watched_trakt(self):
+ if self.is_movie:
self.trakt_api.mark_watched(self.trakt, self.plex.seen_date)
+ if self.is_episode:
+ self.trakt_api.mark_watched(self.trakt, self.plex.seen_date, self.show_trakt_id)
def mark_watched_plex(self):
self.plex_api.mark_watched(self.plex.item)

MODIFY
plextraktsync/trakt_api.py
plextraktsync/trakt_api.py
@@ -169,12 +169,12 @@ def scrobbler(media: Union[Movie, TVEpisode]) -> ScrobblerProxy:
@nocache
@rate_limit()
@time_limit()
- def mark_watched(self, m, time):
+ def mark_watched(self, m, time, show_trakt_id=None):
m.mark_as_seen(time)
if m.media_type == "movies":
self.watched_movies.add(m.trakt)
- if m.media_type == "episodes":
- self.watched_shows.add(TVShow(m.show).trakt, m.season, m.number)
+ if m.media_type == "episodes" and show_trakt_id:
+ self.watched_shows.add(show_trakt_id, m.season, m.number)
def add_to_collection(self, m, pm: PlexLibraryItem):
if m.media_type == "movies":

Remove unnecessary request to trakt api to fetch show id