From 8029cd3ebb022817657e870e773ac4f1225e3b24 Mon Sep 17 00:00:00 2001 From: Claus Vium Date: Tue, 12 Feb 2019 19:50:19 +0100 Subject: Add better language support --- MediaBrowser.Controller/Library/TVUtils.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'MediaBrowser.Controller/Library') diff --git a/MediaBrowser.Controller/Library/TVUtils.cs b/MediaBrowser.Controller/Library/TVUtils.cs index 0089f65d0d..355e97db15 100644 --- a/MediaBrowser.Controller/Library/TVUtils.cs +++ b/MediaBrowser.Controller/Library/TVUtils.cs @@ -17,6 +17,16 @@ namespace MediaBrowser.Controller.Library /// public static readonly string BannerUrl = TvdbBaseUrl + "banners/"; + public static string NormalizeLanguage(string language) + { + if (string.IsNullOrWhiteSpace(language)) + { + return null; + } + + // pt-br is just pt to tvdb + return language.Split('-')[0].ToLowerInvariant(); + } /// /// Gets the air days. /// -- cgit v1.2.3