From 02b7a81f4b6f93d06e59f06791e99e1860e3ebe9 Mon Sep 17 00:00:00 2001 From: davidemarcoli Date: Sat, 19 Oct 2024 13:02:28 +0200 Subject: [PATCH] fix: files sometimes not found in mount --- src/program/symlink.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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():