Skip to content

Commit

Permalink
create download menu to choose download options
Browse files Browse the repository at this point in the history
  • Loading branch information
sudoAlphaX committed Jan 14, 2025
1 parent b91f4f5 commit 1a458c9
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions fastanime/cli/interfaces/anilist_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,40 @@ def fetch_anime_episode(
provider_anime_episodes_menu(config, fastanime_runtime_state)


#
# ---- ANIME DOWNLOAD MENU ----
#


def download_options_menu(
config: "Config", fastanime_runtime_state: "FastAnimeRuntimeState"
):
options = ["Download all", "Download selected", "Back"]
download_option: str = ""
if config.use_fzf:
download_option = fzf.run(
options,
"Enter your preferred download option for the current anime",
)
elif config.use_rofi:
download_option = Rofi.run(
options,
"Enter your preferred download option for the current anime",
)
else:
download_option = fuzzy_inquirer(
options,
"Enter your preferred download option for the current anime",
)

if download_option == "Download all":
pass
elif download_option == "Download selected":
selected_episodes = select_episodes(config, fastanime_runtime_state)

Check failure on line 866 in fastanime/cli/interfaces/anilist_interfaces.py

View workflow job for this annotation

GitHub Actions / test (3.11)

Ruff (F841)

fastanime/cli/interfaces/anilist_interfaces.py:866:9: F841 Local variable `selected_episodes` is assigned to but never used

Check failure on line 866 in fastanime/cli/interfaces/anilist_interfaces.py

View workflow job for this annotation

GitHub Actions / test (3.11)

Ruff (F821)

fastanime/cli/interfaces/anilist_interfaces.py:866:29: F821 Undefined name `select_episodes`
elif download_option == "Back":
media_actions_menu(config, fastanime_runtime_state)
return

#
# ---- ANIME PROVIDER SEARCH RESULTS MENU ----
#
Expand Down

0 comments on commit 1a458c9

Please sign in to comment.