update MovieDb providers to search for images using all languages

This commit is contained in:
Luke Pulverenti
2016-03-04 12:38:51 -05:00
parent 22377f2516
commit 21ebd05a0e
6 changed files with 45 additions and 50 deletions

View File

@@ -169,11 +169,10 @@ namespace MediaBrowser.Providers.BoxSets
if (!string.IsNullOrEmpty(language))
{
url += string.Format("&language={0}", language);
}
var includeImageLanguageParam = MovieDbProvider.GetImageLanguagesParam(language);
// Get images in english and with no language
url += "&include_image_language=" + includeImageLanguageParam;
// Get images in english and with no language
url += "&include_image_language=" + MovieDbProvider.GetImageLanguagesParam(language);
}
cancellationToken.ThrowIfCancellationRequested();
@@ -196,7 +195,13 @@ namespace MediaBrowser.Providers.BoxSets
{
if (!string.IsNullOrEmpty(language) && !string.Equals(language, "en", StringComparison.OrdinalIgnoreCase))
{
url = string.Format(GetCollectionInfo3, id, MovieDbSearch.ApiKey) + "&include_image_language=en,null&language=en";
url = string.Format(GetCollectionInfo3, id, MovieDbSearch.ApiKey) + "&language=en";
if (!string.IsNullOrEmpty(language))
{
// Get images in english and with no language
url += "&include_image_language=" + MovieDbProvider.GetImageLanguagesParam(language);
}
using (var json = await MovieDbProvider.Current.GetMovieDbResponse(new HttpRequestOptions
{
@@ -239,15 +244,9 @@ namespace MediaBrowser.Providers.BoxSets
private static string GetDataFilePath(IApplicationPaths appPaths, string tmdbId, string preferredLanguage)
{
if (string.IsNullOrWhiteSpace(preferredLanguage))
{
throw new ArgumentNullException("preferredLanguage");
}
var path = GetDataPath(appPaths, tmdbId);
var filename = string.Format("all-{0}.json",
preferredLanguage);
var filename = string.Format("all-{0}.json", preferredLanguage ?? string.Empty);
return Path.Combine(path, filename);
}