diff --git a/backend/program/symlink.py b/backend/program/symlink.py index 78fa8c52..333888df 100644 --- a/backend/program/symlink.py +++ b/backend/program/symlink.py @@ -10,7 +10,18 @@ class Symlinker(threading.Thread): - """Content class for mdblist""" + """ + A class that represents a symlinker thread. + + Attributes: + media_items (MediaItemContainer): The container of media items. + running (bool): Flag indicating if the thread is running. + cache (dict): A dictionary to cache file paths. + mount_path (str): The absolute path of the container mount. + host_path (str): The absolute path of the host mount. + symlink_path (str): The path where the symlinks will be created. + cache_thread (ThreadRunner): The thread runner for updating the cache. + """ def __init__(self, media_items: MediaItemContainer): # Symlinking is required @@ -95,9 +106,10 @@ def _run(self): episode = obj["episode"] if type(episode) == list: for sub_episode in episode: - season.episodes[sub_episode - 1].set( - "file", file["filename"] - ) + if sub_episode - 1 in range(len(season.episodes)): + season.episodes[sub_episode - 1].set( + "file", file["filename"] + ) else: index = obj["episode"] - 1 if index in range(len(season.episodes)):