aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Library
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller/Library')
-rw-r--r--MediaBrowser.Controller/Library/TVUtils.cs10
1 files changed, 10 insertions, 0 deletions
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
/// </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>