From 1a458c927ef3961539d4ba1a866285e379bb152b Mon Sep 17 00:00:00 2001 From: Alpha <43486986+sudoAlphaX@users.noreply.github.com> Date: Wed, 15 Jan 2025 00:15:12 +0530 Subject: [PATCH] create download menu to choose download options --- .../cli/interfaces/anilist_interfaces.py | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/fastanime/cli/interfaces/anilist_interfaces.py b/fastanime/cli/interfaces/anilist_interfaces.py index b7997cb..763ca33 100644 --- a/fastanime/cli/interfaces/anilist_interfaces.py +++ b/fastanime/cli/interfaces/anilist_interfaces.py @@ -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) + elif download_option == "Back": + media_actions_menu(config, fastanime_runtime_state) + return + # # ---- ANIME PROVIDER SEARCH RESULTS MENU ---- #