mirror of
https://github.com/glomatico/votify.git
synced 2026-09-28 20:12:13 +02:00
Add format_name property to AudioQuality
This commit is contained in:
@@ -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"}
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user