mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-26 19:05:13 +00:00
feat(subtitle): support 'original' sub_format to keep source format
This commit is contained in:
@@ -131,6 +131,8 @@ class SubtitleCodecChoice(click.Choice):
|
||||
if value_lower not in choices:
|
||||
choices.append(value_lower)
|
||||
|
||||
choices.append("original")
|
||||
|
||||
self.aliases = aliases
|
||||
super().__init__(choices, case_sensitive=False)
|
||||
|
||||
@@ -138,6 +140,9 @@ class SubtitleCodecChoice(click.Choice):
|
||||
if not value:
|
||||
return None
|
||||
|
||||
if str(value).lower() == "original":
|
||||
return "original"
|
||||
|
||||
# First try to convert using the parent class
|
||||
converted_value = super().convert(value, param, ctx)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user