import questionary
import typer
from .audio import audio
from .frames import frames
#from .thumbnails import thumbnails
#from .keyframes import keyframes
#from .audio_track import audio_track
#from .audio_channels import audio_channels
#from .subtitles import subtitles
#from .subtitles_track import subtitles_track
#from .subtitles_convert import subtitles_convert
#from .chapters import chapters
#from .attachments import attachments

def extract_main(cPath):

    while True:
        print(f"""
╔══════════════════════════════════════╗
║          EXTRACTING MENU          ║
╚══════════════════════════════════════╝
""")

        choice= questionary.select(
           "select the editing option you want:",
          choices=[
                "extract frames",
                "extract audio",
                "extract subtitles",
                "extract chapters",
                "extract thumbnails",
                "extract keyframes",
                "extract audio_track",
                "extract audio_channels",
                "extract subtitles_track",
                "subtitles convert",
                "extract attachments",
                "Back to main menu",
                "exit"
            ]).ask()
        if choice is None:
            raise typer.Exit()

        if choice=="extract audio":
           audio(cPath)

        elif choice=="extract frames":
            frames(cPath)

        elif choice=="Back to main menu":
            return

        elif choice=="exit":
           raise typer.Exit()