diff --git a/votify/interface/constants.py b/votify/interface/constants.py index 933438b..9f84eaa 100644 --- a/votify/interface/constants.py +++ b/votify/interface/constants.py @@ -47,6 +47,15 @@ FORMAT_ID_MAP = { "flac": "17", } +FORMAT_NAME_MAP = { + "aac-high": "MP4_256", + "aac-medium": "MP4_128", + "vorbis-low": "OGG_VORBIS_96", + "vorbis-medium": "OGG_VORBIS_160", + "vorbis-high": "OGG_VORBIS_320", + "flac": "FLAC", +} + MP4_AUDIO_QUALITIES = {"aac-high", "aac-medium", "flac"} VORBIS_AUDIO_QUALITIES = {"vorbis-high", "vorbis-medium", "vorbis-low"} PREMIUM_AUDIO_QUALITIES = {"aac-high", "vorbis-high", "flac"} diff --git a/votify/interface/enums.py b/votify/interface/enums.py index 8dc741d..83083d9 100644 --- a/votify/interface/enums.py +++ b/votify/interface/enums.py @@ -9,6 +9,7 @@ from .constants import ( MP4_AUDIO_QUALITIES, PREMIUM_AUDIO_QUALITIES, VORBIS_AUDIO_QUALITIES, + FORMAT_NAME_MAP, ) @@ -84,6 +85,10 @@ class AudioQuality(Enum): def format_id(self) -> str | None: return FORMAT_ID_MAP.get(self.value) + @property + def format_name(self) -> str | None: + return FORMAT_NAME_MAP.get(self.value) + @property def previous_quality(self) -> "AudioQuality" | None: if not self.mp4: