diff options
| author | Claus Vium <clausvium@gmail.com> | 2019-02-12 19:50:19 +0100 |
|---|---|---|
| committer | Claus Vium <clausvium@gmail.com> | 2019-02-15 19:33:10 +0100 |
| commit | 8029cd3ebb022817657e870e773ac4f1225e3b24 (patch) | |
| tree | 13ccf371776673623ea89b264f1d72058470fcfa /MediaBrowser.Controller | |
| parent | e970d7a6aa87f007df77588f2749062717531bc9 (diff) | |
Add better language support
Diffstat (limited to 'MediaBrowser.Controller')
| -rw-r--r-- | MediaBrowser.Controller/Library/TVUtils.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/Library/TVUtils.cs b/MediaBrowser.Controller/Library/TVUtils.cs index 0089f65d0..355e97db1 100644 --- a/MediaBrowser.Controller/Library/TVUtils.cs +++ b/MediaBrowser.Controller/Library/TVUtils.cs @@ -17,6 +17,16 @@ namespace MediaBrowser.Controller.Library /// </summary> 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(); + } /// <summary> /// Gets the air days. /// </summary> |
