From c1498aa73b2e79123ec6d663fb56bd3807d09e80 Mon Sep 17 00:00:00 2001 From: MoojMidge <56883549+MoojMidge@users.noreply.github.com> Date: Wed, 27 Jul 2022 00:16:04 +1000 Subject: [PATCH] Update check for filename of multi-part episodes Filenames stored in library may not match filename actually being played e.g. when using strm files or other playlist like files. --- resources/lib/api.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/lib/api.py b/resources/lib/api.py index 1f7adde7..d29fc550 100644 --- a/resources/lib/api.py +++ b/resources/lib/api.py @@ -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: