Skip to content

Commit

Permalink
Pass show property when creating PlexLibraryItem
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed Oct 24, 2022
1 parent e4408c5 commit f10d7a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion plextraktsync/plex_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ def watch_progress(self, view_offset):

def episodes(self):
for ep in self._get_episodes():
yield PlexLibraryItem(ep, plex=self.plex)
yield PlexLibraryItem(ep, show=self.item, plex=self.plex)

@nocache
@retry()
Expand Down
10 changes: 5 additions & 5 deletions plextraktsync/walker.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
from plextraktsync.decorators.cached_property import cached_property
from plextraktsync.decorators.measure_time import measure_time
from plextraktsync.media import Media, MediaFactory
from plextraktsync.plex_api import (PlexApi, PlexGuid, PlexLibraryItem,
PlexLibrarySection)
from plextraktsync.plex_api import PlexApi, PlexLibraryItem, PlexLibrarySection
from plextraktsync.trakt_api import TraktApi, TraktItem


Expand Down Expand Up @@ -276,11 +275,12 @@ def walk_shows(self, shows: Set[Media], title="Processing Shows"):
def get_plex_episodes(self, episodes: List[Episode]):
it = self.progressbar(episodes, desc="Processing episodes")
for pe in it:
guid = PlexGuid(pe.grandparentGuid, "show")
show = self.mf.resolve_guid(guid)
ps = self.plex.fetch_item(pe.grandparentKey)
show = self.mf.resolve_any(ps)
if not show:
continue
me = self.mf.resolve_any(PlexLibraryItem(pe, plex=self.plex), show)
pm = PlexLibraryItem(pe, show=ps.item, plex=self.plex)
me = self.mf.resolve_any(pm, show)
if not me:
continue

Expand Down

0 comments on commit f10d7a3

Please sign in to comment.