Skip to content

Commit

Permalink
Remove _get_episodes wrapper
Browse files Browse the repository at this point in the history
With @flatten_list can use yield and @Retry together
  • Loading branch information
glensc committed Oct 24, 2022
1 parent f10d7a3 commit ddbb53d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions plextraktsync/plex_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,14 +400,12 @@ def watch_progress(self, view_offset):
percent = view_offset / self.item.duration * 100
return percent

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

@nocache
@retry()
def _get_episodes(self):
return self.item.episodes()
@flatten_list
def episodes(self):
for ep in self.item.episodes():
yield PlexLibraryItem(ep, show=self.item, plex=self.plex)

@cached_property
def season_number(self):
Expand Down

0 comments on commit ddbb53d

Please sign in to comment.