preserve subtitle language labels

This commit is contained in:
dirtydishes 2026-05-25 13:48:22 -04:00
parent 0e751e4486
commit 1b3a2529a7
6 changed files with 328 additions and 1 deletions

View file

@ -48,13 +48,48 @@ enum SubtitleDisplayName {
]
private static let languageCodeAliases = [
"ara": "ar",
"ar": "ar",
"cze": "cs",
"ces": "cs",
"cs": "cs",
"dan": "da",
"da": "da",
"de": "de",
"deu": "de",
"ell": "el",
"el": "el",
"eng": "en",
"en": "en",
"fin": "fi",
"fi": "fi",
"spa": "es",
"es": "es",
"ger": "de",
"gre": "el",
"heb": "he",
"he": "he",
"hun": "hu",
"hu": "hu",
"fre": "fr",
"fra": "fr",
"fr": "fr"
"fr": "fr",
"dut": "nl",
"nld": "nl",
"nl": "nl",
"per": "fa",
"fas": "fa",
"fa": "fa",
"pob": "pt",
"por": "pt",
"pt": "pt",
"ron": "ro",
"rum": "ro",
"ro": "ro",
"srp": "sr",
"sr": "sr",
"tur": "tr",
"tr": "tr"
]
static func displayName(for candidate: SubtitleCandidate) -> String {

View file

@ -329,6 +329,7 @@ final class VLCNativePlaybackBackend: NSObject, NativePlaybackBackend {
.filter { $0.id >= 0 }
.filter { !externalSubtitleBaselineTrackIDs.contains($0.id) }
.filter { externalSubtitleDisplayNamesByTrackID[$0.id] == nil }
.filter { SubtitleDisplayName.isGenericLabel($0.name) }
.sorted { $0.id < $1.id }
.forEach { track in
guard !pendingExternalSubtitleDisplayNames.isEmpty else {