fix(cli): make the click param types the one source of codec spellings

--acodec now lists its codecs in --help, --vcodec drops the duplicate entries, and the REST API derives its allowlists from the same types, so AC-4, DDP, VORB and sub_format "original" stop being rejected and H264 stops being silently dropped. Adds shell completion for --acodec and repairs MultipleChoice completion. Raises the click floor to 8.2.
This commit is contained in:
imSp4rky
2026-09-17 19:22:19 -06:00
parent 372eb5ccf1
commit cf2906f120
13 changed files with 171 additions and 72 deletions
+2 -4
View File
@@ -18,6 +18,7 @@ from typing import Any, Callable, Dict, List, Optional
from unshackle.core.api.events import bus, publish_service_event
from unshackle.core.api.sanitize import sanitize_log
from unshackle.core.utils.click_types import VIDEO_CODEC_LIST
from unshackle.core.utils.redact import REDACTED, URL_USERINFO_RE, redact_path, redact_text
log = logging.getLogger("download_manager")
@@ -387,10 +388,7 @@ def perform_download(
vcodec_raw = params.get("vcodec")
if vcodec_raw:
if isinstance(vcodec_raw, str):
vcodec_raw = [vcodec_raw]
if isinstance(vcodec_raw, list) and vcodec_raw and not isinstance(vcodec_raw[0], Video.Codec):
params["vcodec"] = to_enum(vcodec_raw, Video.Codec)
params["vcodec"] = VIDEO_CODEC_LIST.convert(vcodec_raw)
else:
params["vcodec"] = []