From cd94f749205a7fdaf1f5b79ae32c7f45dc2f5255 Mon Sep 17 00:00:00 2001 From: Jordan Sim-Smith Date: Mon, 28 Oct 2024 20:27:42 +0900 Subject: [PATCH] Strip file extension for episodes to preserve backwards compatibility --- immersion_tracker_api/script/sync_episodes.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/immersion_tracker_api/script/sync_episodes.py b/immersion_tracker_api/script/sync_episodes.py index 1e99f38..6a03fdc 100644 --- a/immersion_tracker_api/script/sync_episodes.py +++ b/immersion_tracker_api/script/sync_episodes.py @@ -2,6 +2,7 @@ import requests import json import urllib.parse +import pathlib def main(): @@ -34,7 +35,7 @@ def find_local_episodes_watched(): if not os.path.isfile(os.path.join(watched, episode)): continue - episode = {"folder_name": show, "file_name": os.path.basename(episode)} + episode = {"folder_name": show, "file_name": pathlib.Path(episode).stem} episodes.append(episode) return episodes