Skip to content

Commit

Permalink
Update check for filename of multi-part episodes
Browse files Browse the repository at this point in the history
Filenames stored in library may not match filename actually being played e.g. when using strm files or other playlist like files.
  • Loading branch information
MoojMidge committed Aug 8, 2022
1 parent 756e718 commit c1498aa
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 c1498aa

Please sign in to comment.