diff --git a/src/program/symlink.py b/src/program/symlink.py index 68a07aff..0123ab0f 100644 --- a/src/program/symlink.py +++ b/src/program/symlink.py @@ -303,8 +303,12 @@ def _get_item_path(item: Union[Movie, Episode]) -> Optional[Path]: rclone_path = Path(settings_manager.settings.symlink.rclone_path) possible_folders = [item.folder, item.file, item.alternative_folder] + possible_folders_without_duplicates = list(set(possible_folders)) + if len(possible_folders_without_duplicates) == 1: + new_possible_folder = Path(possible_folders_without_duplicates[0]).with_suffix("") + possible_folders_without_duplicates.append(new_possible_folder) - for folder in possible_folders: + for folder in possible_folders_without_duplicates: if folder: file_path = rclone_path / folder / item.file if file_path.exists():