Skip to content

Commit

Permalink
Update PlexLibraryItem._get_episodes to reuse code
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed Jan 2, 2025
1 parent ac685c9 commit c7cec17
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions plextraktsync/plex/PlexLibraryItem.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,13 +335,11 @@ def episodes(self):

@retry()
def _get_episodes(self):
filters = {"show.id": self.show_id}
if self.type == "season":
show_id = self.item.parentRatingKey
season = self.item.seasonNumber
filters["season.index"] = self.season_number

return self.library.search(libtype="episode", filters={"show.id": show_id, "season.index": season})

return self.library.search(libtype="episode", filters={"show.id": self.item.ratingKey})
return self.library.search(libtype="episode", filters=filters)

@cached_property
def season_number(self):
Expand Down

0 comments on commit c7cec17

Please sign in to comment.