Skip to content

Commit

Permalink
fix: files sometimes not found in mount
Browse files Browse the repository at this point in the history
  • Loading branch information
davidemarcoli authored and Gaisberg committed Oct 21, 2024
1 parent efbc471 commit 02b7a81
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/program/symlink.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit 02b7a81

Please sign in to comment.