Skip to content

Commit

Permalink
Non-tested download path fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Tmaster055 committed Dec 12, 2024
1 parent 7fd2eae commit e07f12d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/aniworld/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,13 +363,19 @@ def get_language_from_key(key: int) -> str:

return language

output_directory = os.getenv("OUTPUT_DIRECTORY") or params['output_directory']

if sanitize_anime_title in output_directory:
anime_folder = f"{sanitize_anime_title}"
else:
anime_folder = f"{sanitize_anime_title}/{sanitize_anime_title}"

file_name = (
f"{sanitize_anime_title}/{sanitize_anime_title} - S{params['season_number']}E{params['episode_number']}"
f"{anime_folder} - S{params['season_number']}E{params['episode_number']}"
if params['season_number']
else f"{sanitize_anime_title}/{sanitize_anime_title} - Movie {params['episode_number']}"
else f"{anime_folder} - Movie {params['episode_number']}"
)

output_directory = os.getenv("OUTPUT_DIRECTORY") or params['output_directory']

file_path = os.path.join(
output_directory,
Expand Down

0 comments on commit e07f12d

Please sign in to comment.