Merge pull request #1543 from MediaBrowser/dev

Dev
This commit is contained in:
Luke 2016-03-12 10:23:06 -05:00
commit b063083055
6 changed files with 24 additions and 8 deletions

View File

@ -168,7 +168,7 @@ namespace MediaBrowser.Providers.BoxSets
if (!string.IsNullOrEmpty(language)) if (!string.IsNullOrEmpty(language))
{ {
url += string.Format("&language={0}", language); url += string.Format("&language={0}", MovieDbProvider.NormalizeLanguage(language));
// Get images in english and with no language // Get images in english and with no language
url += "&include_image_language=" + MovieDbProvider.GetImageLanguagesParam(language); url += "&include_image_language=" + MovieDbProvider.GetImageLanguagesParam(language);

View File

@ -16,12 +16,14 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using System.Linq;
using System.Net; using System.Net;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using CommonIO; using CommonIO;
using MediaBrowser.Common; using MediaBrowser.Common;
using MediaBrowser.Model.Net; using MediaBrowser.Model.Net;
using MediaBrowser.Model.Extensions;
namespace MediaBrowser.Providers.Movies namespace MediaBrowser.Providers.Movies
{ {
@ -279,6 +281,20 @@ namespace MediaBrowser.Providers.Movies
return string.Join(",", languages.ToArray()); return string.Join(",", languages.ToArray());
} }
public static string NormalizeLanguage(string language)
{
// They require this to be uppercase
// http://emby.media/community/index.php?/topic/32454-fr-follow-tmdbs-new-language-api-update/?p=311148
var parts = language.Split('-');
if (parts.Length == 2)
{
language = parts[0] + "-" + parts[1].ToUpper();
}
return language;
}
/// <summary> /// <summary>
/// Fetches the main result. /// Fetches the main result.
/// </summary> /// </summary>
@ -293,7 +309,7 @@ namespace MediaBrowser.Providers.Movies
if (!string.IsNullOrEmpty(language)) if (!string.IsNullOrEmpty(language))
{ {
url += string.Format("&language={0}", language); url += string.Format("&language={0}", NormalizeLanguage(language));
// Get images in english and with no language // Get images in english and with no language
url += "&include_image_language=" + GetImageLanguagesParam(language); url += "&include_image_language=" + GetImageLanguagesParam(language);

View File

@ -201,7 +201,7 @@ namespace MediaBrowser.Providers.TV
if (!string.IsNullOrEmpty(language)) if (!string.IsNullOrEmpty(language))
{ {
url += string.Format("&language={0}", language); url += string.Format("&language={0}", MovieDbProvider.NormalizeLanguage(language));
} }
var includeImageLanguageParam = MovieDbProvider.GetImageLanguagesParam(language); var includeImageLanguageParam = MovieDbProvider.GetImageLanguagesParam(language);

View File

@ -301,7 +301,7 @@ namespace MediaBrowser.Providers.TV
if (!string.IsNullOrEmpty(language)) if (!string.IsNullOrEmpty(language))
{ {
url += string.Format("&language={0}", language); url += string.Format("&language={0}", MovieDbProvider.NormalizeLanguage(language));
// Get images in english and with no language // Get images in english and with no language
url += "&include_image_language=" + MovieDbProvider.GetImageLanguagesParam(language); url += "&include_image_language=" + MovieDbProvider.GetImageLanguagesParam(language);

View File

@ -295,7 +295,7 @@ namespace MediaBrowser.WebDashboard.Api
} }
} }
html = html.Replace("<body>", "<body><paper-drawer-panel class=\"mainDrawerPanel mainDrawerPanelPreInit\" forceNarrow><div class=\"mainDrawer\" drawer></div><div class=\"mainDrawerPanelContent\" main><!--<div class=\"pageContainer\">") html = html.Replace("<body>", "<body><paper-drawer-panel class=\"mainDrawerPanel mainDrawerPanelPreInit skinContainer\" forceNarrow><div class=\"mainDrawer\" drawer></div><div class=\"mainDrawerPanelContent\" main><!--<div class=\"pageBackground\"></div><div class=\"pageContainer\">")
.Replace("</body>", "</div>--></div></paper-drawer-panel></body>"); .Replace("</body>", "</div>--></div></paper-drawer-panel></body>");
} }

View File

@ -284,6 +284,9 @@
<Content Include="dashboard-ui\robots.txt"> <Content Include="dashboard-ui\robots.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="dashboard-ui\scripts\autobackdrops.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\scripts\homenextup.js"> <Content Include="dashboard-ui\scripts\homenextup.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
@ -859,9 +862,6 @@
<Content Include="dashboard-ui\nowplaying.html"> <Content Include="dashboard-ui\nowplaying.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="dashboard-ui\scripts\backdrops.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\scripts\channelitems.js"> <Content Include="dashboard-ui\scripts\channelitems.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>