Remove unnecessary LANGUAGE_MUX_MAP

This language tag/code mapping table is no longer needed as of MKVToolNix v67, which has been the minimum supported version for some time now already.
This commit is contained in:
rlaphoenix 2024-02-17 23:19:07 +00:00
parent 81dca063fa
commit d65d29efa3
2 changed files with 4 additions and 22 deletions

View File

@ -5,18 +5,6 @@ DOWNLOAD_CANCELLED = Event()
DOWNLOAD_LICENCE_ONLY = Event() DOWNLOAD_LICENCE_ONLY = Event()
DRM_SORT_MAP = ["ClearKey", "Widevine"] DRM_SORT_MAP = ["ClearKey", "Widevine"]
LANGUAGE_MUX_MAP = {
# List of language tags that cannot be used by mkvmerge and need replacements.
# Try get the replacement to be as specific locale-wise as possible.
# A bcp47 as the replacement is recommended.
"cmn": "zh",
"cmn-Hant": "zh-Hant",
"cmn-Hans": "zh-Hans",
"none": "und",
"yue": "zh-yue",
"yue-Hant": "zh-yue-Hant",
"yue-Hans": "zh-yue-Hans"
}
TERRITORY_MAP = { TERRITORY_MAP = {
"Hong Kong SAR China": "Hong Kong" "Hong Kong SAR China": "Hong Kong"
} }

View File

@ -13,7 +13,7 @@ from rich.tree import Tree
from devine.core.config import config from devine.core.config import config
from devine.core.console import console from devine.core.console import console
from devine.core.constants import LANGUAGE_MAX_DISTANCE, LANGUAGE_MUX_MAP, AnyTrack, TrackT from devine.core.constants import LANGUAGE_MAX_DISTANCE, AnyTrack, TrackT
from devine.core.tracks.audio import Audio from devine.core.tracks.audio import Audio
from devine.core.tracks.chapters import Chapter, Chapters from devine.core.tracks.chapters import Chapter, Chapters
from devine.core.tracks.subtitle import Subtitle from devine.core.tracks.subtitle import Subtitle
@ -306,9 +306,7 @@ class Tracks:
if callable(vt.OnMultiplex): if callable(vt.OnMultiplex):
vt.OnMultiplex() vt.OnMultiplex()
cl.extend([ cl.extend([
"--language", "0:{}".format(LANGUAGE_MUX_MAP.get( "--language", f"0:{vt.language}",
str(vt.language), str(vt.language)
)),
"--default-track", f"0:{i == 0}", "--default-track", f"0:{i == 0}",
"--original-flag", f"0:{vt.is_original_lang}", "--original-flag", f"0:{vt.is_original_lang}",
"--compression", "0:none", # disable extra compression "--compression", "0:none", # disable extra compression
@ -322,9 +320,7 @@ class Tracks:
at.OnMultiplex() at.OnMultiplex()
cl.extend([ cl.extend([
"--track-name", f"0:{at.get_track_name() or ''}", "--track-name", f"0:{at.get_track_name() or ''}",
"--language", "0:{}".format(LANGUAGE_MUX_MAP.get( "--language", f"0:{at.language}",
str(at.language), str(at.language)
)),
"--default-track", f"0:{i == 0}", "--default-track", f"0:{i == 0}",
"--visual-impaired-flag", f"0:{at.descriptive}", "--visual-impaired-flag", f"0:{at.descriptive}",
"--original-flag", f"0:{at.is_original_lang}", "--original-flag", f"0:{at.is_original_lang}",
@ -340,9 +336,7 @@ class Tracks:
default = bool(self.audio and is_close_match(st.language, [self.audio[0].language]) and st.forced) default = bool(self.audio and is_close_match(st.language, [self.audio[0].language]) and st.forced)
cl.extend([ cl.extend([
"--track-name", f"0:{st.get_track_name() or ''}", "--track-name", f"0:{st.get_track_name() or ''}",
"--language", "0:{}".format(LANGUAGE_MUX_MAP.get( "--language", f"0:{st.language}",
str(st.language), str(st.language)
)),
"--sub-charset", "0:UTF-8", "--sub-charset", "0:UTF-8",
"--forced-track", f"0:{st.forced}", "--forced-track", f"0:{st.forced}",
"--default-track", f"0:{default}", "--default-track", f"0:{default}",