This commit is contained in:
nose
2025-12-14 00:53:52 -08:00
parent 52a79b0086
commit a03eb0d1be
24 changed files with 2785 additions and 1868 deletions

View File

@@ -642,7 +642,7 @@ def _download_direct_file(
return DownloadMediaResult(
path=file_path,
info=info,
tags=tags,
tag=tags,
source_url=url,
hash_value=hash_value,
)

View File

@@ -36,6 +36,7 @@ mime_maps = {
"mp3": { "ext": ".mp3", "mimes": ["audio/mpeg", "audio/mp3"] },
"m4a": { "ext": ".m4a", "mimes": ["audio/mp4", "audio/x-m4a"] },
"ogg": { "ext": ".ogg", "mimes": ["audio/ogg"] },
"opus": { "ext": ".opus", "mimes": ["audio/opus"] },
"flac": { "ext": ".flac", "mimes": ["audio/flac"] },
"wav": { "ext": ".wav", "mimes": ["audio/wav", "audio/x-wav", "audio/vnd.wave"] },
"wma": { "ext": ".wma", "mimes": ["audio/x-ms-wma"] },
@@ -98,3 +99,13 @@ def get_type_from_ext(ext: str) -> str:
return type_name
return 'other'
# Canonical supported extension set for all stores/cmdlets.
# Derived from mime_maps so there is a single source of truth.
ALL_SUPPORTED_EXTENSIONS: set[str] = {
spec["ext"].lower()
for group in mime_maps.values()
for spec in group.values()
if isinstance(spec, dict) and isinstance(spec.get("ext"), str) and spec.get("ext")
}