mirror of
https://github.com/Benexl/FastAnime.git
synced 2025-12-12 15:50:01 -08:00
feat(player-controls-menu): add media actions menu option
This commit is contained in:
@@ -68,9 +68,8 @@ def player_controls(ctx: Context, state: State) -> Union[State, InternalDirectiv
|
||||
f"{'🔘 ' if icons else ''}Toggle Translation Type (Current: {ctx.config.stream.translation_type.upper()})": _toggle_config_state(
|
||||
ctx, state, "TRANSLATION_TYPE"
|
||||
),
|
||||
f"{'🏠 ' if icons else ''}Main Menu": lambda: State(
|
||||
menu_name=MenuName.MAIN
|
||||
),
|
||||
f"{'🎥 ' if icons else ''}Media Actions Menu": lambda: InternalDirective.BACKX4,
|
||||
f"{'🏠 ' if icons else ''}Main Menu": lambda: InternalDirective.MAIN,
|
||||
f"{'❌ ' if icons else ''}Exit": lambda: InternalDirective.EXIT,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -247,7 +247,7 @@ class Session:
|
||||
if isinstance(next_step, InternalDirective):
|
||||
if next_step == InternalDirective.MAIN:
|
||||
self._history = [self._history[0]]
|
||||
if next_step == InternalDirective.RELOAD:
|
||||
elif next_step == InternalDirective.RELOAD:
|
||||
continue
|
||||
elif next_step == InternalDirective.CONFIG_EDIT:
|
||||
self._edit_config()
|
||||
@@ -263,6 +263,12 @@ class Session:
|
||||
self._history.pop()
|
||||
self._history.pop()
|
||||
self._history.pop()
|
||||
elif next_step == InternalDirective.BACKX4:
|
||||
if len(self._history) > 4:
|
||||
self._history.pop()
|
||||
self._history.pop()
|
||||
self._history.pop()
|
||||
self._history.pop()
|
||||
elif next_step == InternalDirective.EXIT:
|
||||
break
|
||||
else:
|
||||
|
||||
@@ -14,12 +14,12 @@ class InternalDirective(Enum):
|
||||
|
||||
BACK = "BACK"
|
||||
|
||||
BACK_FORCE = "BACK_FORCE"
|
||||
|
||||
BACKX2 = "BACKX2"
|
||||
|
||||
BACKX3 = "BACKX3"
|
||||
|
||||
BACKX4 = "BACKX4"
|
||||
|
||||
EXIT = "EXIT"
|
||||
|
||||
CONFIG_EDIT = "CONFIG_EDIT"
|
||||
|
||||
Reference in New Issue
Block a user