Skip to content

Commit

Permalink
uses more precise trakt.show_id instead of show.trakt_id
Browse files Browse the repository at this point in the history
  • Loading branch information
simonc56 authored and glensc committed Oct 23, 2022
1 parent 14674d9 commit f69a70f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
5 changes: 1 addition & 4 deletions plextraktsync/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def __init__(
self.mf = mf
self.plex = plex
self.trakt = trakt
self._show = None

@cached_property
def media_type(self):
Expand Down Expand Up @@ -71,9 +70,7 @@ def show(self, show):

@property
def show_trakt_id(self):
if not self.show:
raise RuntimeError("Unexpected call: episode without show property")
return self.show.trakt_id
return getattr(self.trakt, "show_id", None)

@cached_property
def is_movie(self):
Expand Down
3 changes: 2 additions & 1 deletion plextraktsync/pytrakt_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ def __init__(self, show, season, number, ids):
def instance(self):
if self._instance is None:
self._instance = TVEpisode(
self.show.title, self.season, number=self.number, **self.ids
self.show.title, self.season, number=self.number,
show_id=self.show.trakt, **self.ids
)
return self._instance

Expand Down
2 changes: 0 additions & 2 deletions plextraktsync/walker.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,6 @@ def get_plex_episodes(self, episodes):
if not me:
continue

me.show = show
yield me

def media_from_sections(self, sections: List[PlexLibrarySection]):
Expand All @@ -309,7 +308,6 @@ def episode_from_show(self, show: Media):
if not me:
continue

me.show = show
yield me

def progressbar(self, iterable, **kwargs):
Expand Down

0 comments on commit f69a70f

Please sign in to comment.