|
|
@ -66,14 +66,15 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
|
|
|
|
.FindByExternalIdAsync(imdbId, FindExternalSource.Imdb, searchInfo.MetadataLanguage, cancellationToken)
|
|
|
|
.FindByExternalIdAsync(imdbId, FindExternalSource.Imdb, searchInfo.MetadataLanguage, cancellationToken)
|
|
|
|
.ConfigureAwait(false);
|
|
|
|
.ConfigureAwait(false);
|
|
|
|
|
|
|
|
|
|
|
|
if (findResult?.TvResults != null)
|
|
|
|
var tvResults = findResult?.TvResults;
|
|
|
|
|
|
|
|
if (tvResults != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var imdbIdResults = new List<RemoteSearchResult>();
|
|
|
|
var imdbIdResults = new RemoteSearchResult[tvResults.Count];
|
|
|
|
for (var i = 0; i < findResult.TvResults.Count; i++)
|
|
|
|
for (var i = 0; i < tvResults.Count; i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var remoteResult = MapSearchTvToRemoteSearchResult(findResult.TvResults[i]);
|
|
|
|
var remoteResult = MapSearchTvToRemoteSearchResult(tvResults[i]);
|
|
|
|
remoteResult.SetProviderId(MetadataProvider.Imdb, imdbId);
|
|
|
|
remoteResult.SetProviderId(MetadataProvider.Imdb, imdbId);
|
|
|
|
imdbIdResults.Add(remoteResult);
|
|
|
|
imdbIdResults[i] = remoteResult;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return imdbIdResults;
|
|
|
|
return imdbIdResults;
|
|
|
@ -88,14 +89,15 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
|
|
|
|
.FindByExternalIdAsync(tvdbId, FindExternalSource.TvDb, searchInfo.MetadataLanguage, cancellationToken)
|
|
|
|
.FindByExternalIdAsync(tvdbId, FindExternalSource.TvDb, searchInfo.MetadataLanguage, cancellationToken)
|
|
|
|
.ConfigureAwait(false);
|
|
|
|
.ConfigureAwait(false);
|
|
|
|
|
|
|
|
|
|
|
|
if (findResult?.TvResults != null)
|
|
|
|
var tvResults = findResult?.TvResults;
|
|
|
|
|
|
|
|
if (tvResults != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var tvIdResults = new List<RemoteSearchResult>();
|
|
|
|
var tvIdResults = new RemoteSearchResult[tvResults.Count];
|
|
|
|
for (var i = 0; i < findResult.TvResults.Count; i++)
|
|
|
|
for (var i = 0; i < tvResults.Count; i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var remoteResult = MapSearchTvToRemoteSearchResult(findResult.TvResults[i]);
|
|
|
|
var remoteResult = MapSearchTvToRemoteSearchResult(tvResults[i]);
|
|
|
|
remoteResult.SetProviderId(MetadataProvider.Tvdb, tvdbId);
|
|
|
|
remoteResult.SetProviderId(MetadataProvider.Tvdb, tvdbId);
|
|
|
|
tvIdResults.Add(remoteResult);
|
|
|
|
tvIdResults[i] = remoteResult;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return tvIdResults;
|
|
|
|
return tvIdResults;
|
|
|
@ -105,10 +107,10 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
|
|
|
|
var tvSearchResults = await _tmdbClientManager.SearchSeriesAsync(searchInfo.Name, searchInfo.MetadataLanguage, cancellationToken)
|
|
|
|
var tvSearchResults = await _tmdbClientManager.SearchSeriesAsync(searchInfo.Name, searchInfo.MetadataLanguage, cancellationToken)
|
|
|
|
.ConfigureAwait(false);
|
|
|
|
.ConfigureAwait(false);
|
|
|
|
|
|
|
|
|
|
|
|
var remoteResults = new List<RemoteSearchResult>();
|
|
|
|
var remoteResults = new RemoteSearchResult[tvSearchResults.Count];
|
|
|
|
for (var i = 0; i < tvSearchResults.Count; i++)
|
|
|
|
for (var i = 0; i < tvSearchResults.Count; i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
remoteResults.Add(MapSearchTvToRemoteSearchResult(tvSearchResults[i]));
|
|
|
|
remoteResults[i] = MapSearchTvToRemoteSearchResult(tvSearchResults[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return remoteResults;
|
|
|
|
return remoteResults;
|
|
|
@ -236,7 +238,11 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
|
|
|
|
|
|
|
|
|
|
|
|
private Series MapTvShowToSeries(TvShow seriesResult, string preferredCountryCode)
|
|
|
|
private Series MapTvShowToSeries(TvShow seriesResult, string preferredCountryCode)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var series = new Series {Name = seriesResult.Name, OriginalTitle = seriesResult.OriginalName};
|
|
|
|
var series = new Series
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Name = seriesResult.Name,
|
|
|
|
|
|
|
|
OriginalTitle = seriesResult.OriginalName
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
series.SetProviderId(MetadataProvider.Tmdb, seriesResult.Id.ToString(CultureInfo.InvariantCulture));
|
|
|
|
series.SetProviderId(MetadataProvider.Tmdb, seriesResult.Id.ToString(CultureInfo.InvariantCulture));
|
|
|
|
|
|
|
|
|
|
|
@ -322,7 +328,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (TmdbUtils.IsTrailerType(video))
|
|
|
|
if (TmdbUtils.IsTrailerType(video))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
series.AddTrailerUrl($"http://www.youtube.com/watch?v={video.Key}");
|
|
|
|
series.AddTrailerUrl("https://www.youtube.com/watch?v=" + video.Key);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|