Skip to content

Commit

Permalink
Merge pull request #281 from MoojMidge/patch-multi-episode-files
Browse files Browse the repository at this point in the history
Update check for filename of multi-part episodes
  • Loading branch information
MoojMidge authored Sep 2, 2022
2 parents 80258b1 + c1498aa commit fb51984
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion resources/lib/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,14 +300,17 @@ def get_episode_id(showid, show_season, show_episode):

def find_next_episode(self, result, current_file, include_watched, current_episode_id):
found_match = False
current_library_file = current_file
episodes = result.get('result', {}).get('episodes', [])
for episode in episodes:
# Find position of current episode
episode_library_file = episode.get('file')
if current_episode_id == episode.get('episodeid'):
found_match = True
current_library_file = episode_library_file
continue
# Check if it may be a multi-part episode
if episode.get('file') == current_file:
if episode_library_file in (current_file, current_library_file):
continue
# Skip already watched episodes?
if not include_watched and episode.get('playcount') > 0:
Expand Down

0 comments on commit fb51984

Please sign in to comment.