from pathlib import Path

CERT_DIR = Path.home() / ".config" / "gtv"
CERT_FILE = CERT_DIR / "cert.pem"
KEY_FILE = CERT_DIR / "key.pem"
CLIENT_NAME = "GTV-CLI Remote"

REMOTE_KEY_COMMANDS = {
    "up":           "DPAD_UP",
    "down":         "DPAD_DOWN",
    "left":         "DPAD_LEFT",
    "right":        "DPAD_RIGHT",
    "enter":        "DPAD_CENTER",
    "select":       "DPAD_CENTER",
    "ok":           "DPAD_CENTER",
    "back":         "BACK",
    "home":         "HOME",
    "power":        "POWER",
    "play":         "MEDIA_PLAY",
    "pause":        "MEDIA_PAUSE",
    "playpause":    "MEDIA_PLAY_PAUSE",
    "stop":         "MEDIA_STOP",
    "next":         "MEDIA_NEXT",
    "prev":         "MEDIA_PREVIOUS",
    "previous":     "MEDIA_PREVIOUS",
    "rewind":       "MEDIA_REWIND",
    "ff":           "MEDIA_FAST_FORWARD",
    "fastforward":  "MEDIA_FAST_FORWARD",
    "volup":        "VOLUME_UP",
    "voldown":      "VOLUME_DOWN",
    "mute":         "MUTE",
    "menu":         "MENU",
    "settings":     "SETTINGS",
    "search":       "SEARCH",
    "assist":       "ASSIST",
    "info":         "INFO",
    "guide":        "GUIDE",
    "chup":         "CHANNEL_UP",
    "chdown":       "CHANNEL_DOWN",
    "0": "0", "1": "1", "2": "2", "3": "3", "4": "4",
    "5": "5", "6": "6", "7": "7", "8": "8", "9": "9",
    "red":          "PROG_RED",
    "green":        "PROG_GREEN",
    "yellow":       "PROG_YELLOW",
    "blue":         "PROG_BLUE",
    "captions":     "CAPTIONS",
    "record":       "MEDIA_RECORD",
    "audio":        "MEDIA_AUDIO_TRACK",
    "dvr":          "DVR",
    "explorer":     "EXPLORER",
    "teletext":     "TV_TELETEXT",
}

RAW_KEY_CODES = [
    "DPAD_UP", "DPAD_DOWN", "DPAD_LEFT", "DPAD_RIGHT", "DPAD_CENTER",
    "BACK", "HOME", "POWER",
    "MEDIA_PLAY", "MEDIA_PAUSE", "MEDIA_PLAY_PAUSE", "MEDIA_STOP",
    "MEDIA_NEXT", "MEDIA_PREVIOUS", "MEDIA_REWIND", "MEDIA_FAST_FORWARD",
    "MEDIA_RECORD", "MEDIA_AUDIO_TRACK",
    "VOLUME_UP", "VOLUME_DOWN", "VOLUME_MUTE", "MUTE",
    "MENU", "SETTINGS", "SEARCH", "ASSIST", "INFO", "GUIDE",
    "CHANNEL_UP", "CHANNEL_DOWN",
    "PROG_RED", "PROG_GREEN", "PROG_YELLOW", "PROG_BLUE",
    "CAPTIONS", "DVR", "EXPLORER", "TV_TELETEXT",
    "BUTTON_A", "BUTTON_B", "BUTTON_X", "BUTTON_Y", "BUTTON_MODE",
    "ENTER", "DEL",
    "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12",
    "TV",
]

APP_SHORTCUTS = {
    "youtube":  "https://www.youtube.com",
    "netflix":  "com.netflix.ninja",
    "disney":   "com.disney.disneyplus",
    "prime":    "com.amazon.amazonvideo.livingroom",
    "amazon":   "com.amazon.amazonvideo.livingroom",
    "kodi":     "org.xbmc.kodi",
    "plex":     "com.plexapp.android",
    "hbo":      "com.hbo.hbonow",
    "hulu":     "com.hulu.livingroomplus",
    "spotify":  "com.spotify.tv.android",
    "twitch":   "tv.twitch.android.app",
    "browser":  "com.vewd.core.integration.dia",
    "appletv":  "com.apple.atve.androidtv.appletv",
    "crunchyroll": "com.crunchyroll.crunchyroid",
}

BANNER = """
  ▄████▄    ████████   ██▄   ▄██
 ██▀  ▀▀▀   ▀▀▀██▀▀▀   ▀██ ██▀
 ██   ▄██      ██        ▀███▀
 ██▄  ▀██      ██         ███
  ▀████▀       ▀▀         ▀▀▀
  google tv / android tv remote
"""

CAT_CONNECTION = "Connection"
CAT_NAVIGATION = "Navigation"
CAT_MEDIA = "Media"
CAT_VOLUME = "Volume & Power"
CAT_APPS = "Apps & Input"
CAT_DEVICE = "Device Info"
CAT_NUMBERS = "Number Keys"
