Skip to content

Commit

Permalink
Prefer cached trakt show for .show
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed Jan 8, 2024
1 parent 2e1f10e commit dd7b491
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plextraktsync/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from plexapi.exceptions import PlexApiException
from requests import RequestException
from trakt.errors import TraktException
from trakt.tv import TVShow

from plextraktsync.factory import logger
from plextraktsync.trakt.TraktLookup import TraktLookup
Expand Down Expand Up @@ -90,7 +91,11 @@ def trakt_url(self):
def show(self) -> Media | None:
if self._show is None and self.mf and not self.plex.is_discover:
ps = self.plex.show
ms = self.mf.resolve_any(ps)
if isinstance(self.trakt.show, TVShow):
ts = self.trakt.show
ms = self.mf.make_media(trakt=ts, plex=ps)
else:
ms = self.mf.resolve_any(ps)
self._show = ms

return self._show
Expand Down

0 comments on commit dd7b491

Please sign in to comment.