mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 22:07:13 -04:00
fix pt-br from tvdb
This commit is contained in:
parent
eb8110287b
commit
c33992765c
@ -169,10 +169,8 @@ namespace MediaBrowser.Providers.TV
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the episode XML files.
|
/// Gets the episode XML files.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="seasonNumber">The season number.</param>
|
|
||||||
/// <param name="episodeNumber">The episode number.</param>
|
|
||||||
/// <param name="endingEpisodeNumber">The ending episode number.</param>
|
|
||||||
/// <param name="seriesDataPath">The series data path.</param>
|
/// <param name="seriesDataPath">The series data path.</param>
|
||||||
|
/// <param name="searchInfo">The search information.</param>
|
||||||
/// <returns>List{FileInfo}.</returns>
|
/// <returns>List{FileInfo}.</returns>
|
||||||
internal List<XmlReader> GetEpisodeXmlNodes(string seriesDataPath, EpisodeInfo searchInfo)
|
internal List<XmlReader> GetEpisodeXmlNodes(string seriesDataPath, EpisodeInfo searchInfo)
|
||||||
{
|
{
|
||||||
|
@ -58,6 +58,17 @@ namespace MediaBrowser.Providers.TV
|
|||||||
private const string SeriesGetZip = "http://www.thetvdb.com/api/{0}/series/{1}/all/{2}.zip";
|
private const string SeriesGetZip = "http://www.thetvdb.com/api/{0}/series/{1}/all/{2}.zip";
|
||||||
private const string GetSeriesByImdbId = "http://www.thetvdb.com/api/GetSeriesByRemoteID.php?imdbid={0}&language={1}";
|
private const string GetSeriesByImdbId = "http://www.thetvdb.com/api/GetSeriesByRemoteID.php?imdbid={0}&language={1}";
|
||||||
|
|
||||||
|
private string NormalizeLanguage(string language)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(language))
|
||||||
|
{
|
||||||
|
return language;
|
||||||
|
}
|
||||||
|
|
||||||
|
// pt-br is just pt to tvdb
|
||||||
|
return language.Split('-')[0].ToLower();
|
||||||
|
}
|
||||||
|
|
||||||
public async Task<IEnumerable<RemoteSearchResult>> GetSearchResults(SeriesInfo searchInfo, CancellationToken cancellationToken)
|
public async Task<IEnumerable<RemoteSearchResult>> GetSearchResults(SeriesInfo searchInfo, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
if (IsValidSeries(searchInfo.ProviderIds))
|
if (IsValidSeries(searchInfo.ProviderIds))
|
||||||
@ -270,7 +281,7 @@ namespace MediaBrowser.Providers.TV
|
|||||||
|
|
||||||
private async Task<string> GetSeriesByRemoteId(string id, string idType, string language, CancellationToken cancellationToken)
|
private async Task<string> GetSeriesByRemoteId(string id, string idType, string language, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var url = string.Format(GetSeriesByImdbId, id, language);
|
var url = string.Format(GetSeriesByImdbId, id, NormalizeLanguage(language));
|
||||||
|
|
||||||
using (var result = await _httpClient.Get(new HttpRequestOptions
|
using (var result = await _httpClient.Get(new HttpRequestOptions
|
||||||
{
|
{
|
||||||
@ -455,7 +466,7 @@ namespace MediaBrowser.Providers.TV
|
|||||||
|
|
||||||
private async Task<IEnumerable<RemoteSearchResult>> FindSeriesInternal(string name, string language, CancellationToken cancellationToken)
|
private async Task<IEnumerable<RemoteSearchResult>> FindSeriesInternal(string name, string language, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var url = string.Format(SeriesSearchUrl, WebUtility.UrlEncode(name), language.ToLower());
|
var url = string.Format(SeriesSearchUrl, WebUtility.UrlEncode(name), NormalizeLanguage(language));
|
||||||
var doc = new XmlDocument();
|
var doc = new XmlDocument();
|
||||||
|
|
||||||
using (var results = await _httpClient.Get(new HttpRequestOptions
|
using (var results = await _httpClient.Get(new HttpRequestOptions
|
||||||
|
Loading…
Reference in New Issue
Block a user