mirror of
https://github.com/Benexl/FastAnime.git
synced 2026-01-06 09:43:53 -08:00
feat: configurable main_menu
This commit is contained in:
@@ -4,7 +4,7 @@ import os
|
||||
import random
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from click import clear
|
||||
from click import clear, option
|
||||
from InquirerPy import inquirer
|
||||
from InquirerPy.validator import EmptyInputValidator
|
||||
from rich import print
|
||||
@@ -1712,6 +1712,18 @@ def fastanime_main_menu(
|
||||
f"{'📝 ' if icons else ''}Edit Config": _edit_config,
|
||||
f"{'❌ ' if icons else ''}Exit": exit_app,
|
||||
}
|
||||
|
||||
# Load main menu order if set in config file
|
||||
if config.menu_order:
|
||||
menu_order_list = config.menu_order.split(",")
|
||||
lookup = {key.split(" ", 1)[-1]: key for key in options}
|
||||
ordered_dict = {
|
||||
lookup[key]: options[lookup[key]]
|
||||
for key in menu_order_list
|
||||
if key in lookup
|
||||
}
|
||||
options = ordered_dict
|
||||
|
||||
# prompt user to select an action
|
||||
choices = list(options.keys())
|
||||
if config.use_fzf:
|
||||
|
||||
Reference in New Issue
Block a user