pub fn parse_languages(title: &str) -> Vec<Language>Expand description
Public entry point. Mirrors C# LanguageParser.ParseLanguages
(lines 38-215).
Algorithm (read top-to-bottom in the C# source):
- Apply
CleanSeriesTitleRegexto strip any leading show-title. - Twenty-six substring checks against the lowercased title, in
source order. Each hit appends a
Languageto the list. - Append the regex-pass results (case-sensitive LT/CZ/PL/BG/SK first,
then case-insensitive
LanguageRegex). - If the lowercased title contains “english”, append
Language::English. - If the list is empty, append
Language::Unknown. - If the list now contains exactly
[Language::German], apply the DL/ML special handling (DL addsOriginal; ML addsOriginalandEnglish). - Dedup by
Language as i32, preserving first-seen order. C# usesDistinctBy(l => (int)l)which is order-preserving; Rust mirrors this with aHashSet<i32>discriminator and an in-place filter.