mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-07 18:24:19 -04:00
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
This commit is contained in:
commit
061a0c6f55
@ -163,7 +163,7 @@ namespace MediaBrowser.Api.UserLibrary
|
|||||||
|
|
||||||
AlbumCount = items.OfType<MusicAlbum>().Count(),
|
AlbumCount = items.OfType<MusicAlbum>().Count(),
|
||||||
|
|
||||||
EpisodeGuestStarCount = items.OfType<Episode>().Count(i => i.People.Any(p => string.Equals(p.Name, request.Name, StringComparison.OrdinalIgnoreCase) && string.Equals(p.Type, PersonType.GuestStar)))
|
EpisodeCount = items.OfType<Episode>().Count()
|
||||||
};
|
};
|
||||||
|
|
||||||
return ToOptimizedResult(counts);
|
return ToOptimizedResult(counts);
|
||||||
|
@ -107,14 +107,13 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Performs a GET request and returns the resulting stream
|
/// Performs a GET request and returns the resulting stream
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="url">The URL.</param>
|
/// <param name="options">The options.</param>
|
||||||
/// <param name="resourcePool">The resource pool.</param>
|
|
||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
|
||||||
/// <returns>Task{Stream}.</returns>
|
/// <returns>Task{Stream}.</returns>
|
||||||
|
/// <exception cref="HttpException"></exception>
|
||||||
/// <exception cref="MediaBrowser.Model.Net.HttpException"></exception>
|
/// <exception cref="MediaBrowser.Model.Net.HttpException"></exception>
|
||||||
public async Task<Stream> Get(string url, SemaphoreSlim resourcePool, CancellationToken cancellationToken)
|
public async Task<Stream> Get(HttpRequestOptions options)
|
||||||
{
|
{
|
||||||
ValidateParams(url, cancellationToken);
|
ValidateParams(options.Url, options.CancellationToken);
|
||||||
|
|
||||||
//var urlHash = url.GetMD5().ToString();
|
//var urlHash = url.GetMD5().ToString();
|
||||||
//var infoPath = _cacheRepository.GetResourcePath(urlHash + ".js");
|
//var infoPath = _cacheRepository.GetResourcePath(urlHash + ".js");
|
||||||
@ -136,9 +135,9 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
|
|||||||
// return GetCachedResponse(responsePath);
|
// return GetCachedResponse(responsePath);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
cancellationToken.ThrowIfCancellationRequested();
|
options.CancellationToken.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
var message = new HttpRequestMessage(HttpMethod.Get, url);
|
var message = GetHttpRequestMessage(options);
|
||||||
|
|
||||||
//if (cachedInfo != null)
|
//if (cachedInfo != null)
|
||||||
//{
|
//{
|
||||||
@ -152,22 +151,22 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
|
|||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
if (resourcePool != null)
|
if (options.ResourcePool != null)
|
||||||
{
|
{
|
||||||
await resourcePool.WaitAsync(cancellationToken).ConfigureAwait(false);
|
await options.ResourcePool.WaitAsync(options.CancellationToken).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.Info("HttpClientManager.Get url: {0}", url);
|
_logger.Info("HttpClientManager.Get url: {0}", options.Url);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
cancellationToken.ThrowIfCancellationRequested();
|
options.CancellationToken.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
var response = await GetHttpClient(GetHostFromUrl(url)).SendAsync(message, HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
|
var response = await GetHttpClient(GetHostFromUrl(options.Url)).SendAsync(message, HttpCompletionOption.ResponseHeadersRead, options.CancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
EnsureSuccessStatusCode(response);
|
EnsureSuccessStatusCode(response);
|
||||||
|
|
||||||
cancellationToken.ThrowIfCancellationRequested();
|
options.CancellationToken.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
//cachedInfo = UpdateInfoCache(cachedInfo, url, infoPath, response);
|
//cachedInfo = UpdateInfoCache(cachedInfo, url, infoPath, response);
|
||||||
|
|
||||||
@ -187,29 +186,58 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
|
|||||||
}
|
}
|
||||||
catch (OperationCanceledException ex)
|
catch (OperationCanceledException ex)
|
||||||
{
|
{
|
||||||
throw GetCancellationException(url, cancellationToken, ex);
|
throw GetCancellationException(options.Url, options.CancellationToken, ex);
|
||||||
}
|
}
|
||||||
catch (HttpRequestException ex)
|
catch (HttpRequestException ex)
|
||||||
{
|
{
|
||||||
_logger.ErrorException("Error getting response from " + url, ex);
|
_logger.ErrorException("Error getting response from " + options.Url, ex);
|
||||||
|
|
||||||
throw new HttpException(ex.Message, ex);
|
throw new HttpException(ex.Message, ex);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.ErrorException("Error getting response from " + url, ex);
|
_logger.ErrorException("Error getting response from " + options.Url, ex);
|
||||||
|
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
if (resourcePool != null)
|
if (options.ResourcePool != null)
|
||||||
{
|
{
|
||||||
resourcePool.Release();
|
options.ResourcePool.Release();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Performs a GET request and returns the resulting stream
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="url">The URL.</param>
|
||||||
|
/// <param name="resourcePool">The resource pool.</param>
|
||||||
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
|
/// <returns>Task{Stream}.</returns>
|
||||||
|
public Task<Stream> Get(string url, SemaphoreSlim resourcePool, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
return Get(new HttpRequestOptions
|
||||||
|
{
|
||||||
|
Url = url,
|
||||||
|
ResourcePool = resourcePool,
|
||||||
|
CancellationToken = cancellationToken,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the specified URL.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="url">The URL.</param>
|
||||||
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
|
/// <returns>Task{Stream}.</returns>
|
||||||
|
public Task<Stream> Get(string url, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
return Get(url, null, cancellationToken);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the cached response.
|
/// Gets the cached response.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -393,13 +421,6 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
|
|||||||
|
|
||||||
options.CancellationToken.ThrowIfCancellationRequested();
|
options.CancellationToken.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
var message = new HttpRequestMessage(HttpMethod.Get, options.Url);
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(options.UserAgent))
|
|
||||||
{
|
|
||||||
message.Headers.Add("User-Agent", options.UserAgent);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.ResourcePool != null)
|
if (options.ResourcePool != null)
|
||||||
{
|
{
|
||||||
await options.ResourcePool.WaitAsync(options.CancellationToken).ConfigureAwait(false);
|
await options.ResourcePool.WaitAsync(options.CancellationToken).ConfigureAwait(false);
|
||||||
@ -413,7 +434,7 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
|
|||||||
{
|
{
|
||||||
options.CancellationToken.ThrowIfCancellationRequested();
|
options.CancellationToken.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
using (var response = await GetHttpClient(GetHostFromUrl(options.Url)).SendAsync(message, HttpCompletionOption.ResponseHeadersRead, options.CancellationToken).ConfigureAwait(false))
|
using (var response = await GetHttpClient(GetHostFromUrl(options.Url)).SendAsync(GetHttpRequestMessage(options), HttpCompletionOption.ResponseHeadersRead, options.CancellationToken).ConfigureAwait(false))
|
||||||
{
|
{
|
||||||
EnsureSuccessStatusCode(response);
|
EnsureSuccessStatusCode(response);
|
||||||
|
|
||||||
@ -463,6 +484,28 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
|
|||||||
return tempFile;
|
return tempFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the message.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="options">The options.</param>
|
||||||
|
/// <returns>HttpResponseMessage.</returns>
|
||||||
|
private HttpRequestMessage GetHttpRequestMessage(HttpRequestOptions options)
|
||||||
|
{
|
||||||
|
var message = new HttpRequestMessage(HttpMethod.Get, options.Url);
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(options.UserAgent))
|
||||||
|
{
|
||||||
|
message.Headers.Add("User-Agent", options.UserAgent);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(options.AcceptHeader))
|
||||||
|
{
|
||||||
|
message.Headers.Add("Accept", options.AcceptHeader);
|
||||||
|
}
|
||||||
|
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the length of the content.
|
/// Gets the length of the content.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -616,17 +659,6 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the specified URL.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="url">The URL.</param>
|
|
||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
|
||||||
/// <returns>Task{Stream}.</returns>
|
|
||||||
public Task<Stream> Get(string url, CancellationToken cancellationToken)
|
|
||||||
{
|
|
||||||
return Get(url, null, cancellationToken);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Posts the specified URL.
|
/// Posts the specified URL.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -14,6 +14,12 @@ namespace MediaBrowser.Common.Net
|
|||||||
/// <value>The URL.</value>
|
/// <value>The URL.</value>
|
||||||
public string Url { get; set; }
|
public string Url { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the accept header.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The accept header.</value>
|
||||||
|
public string AcceptHeader { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the cancellation token.
|
/// Gets or sets the cancellation token.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -29,6 +29,13 @@ namespace MediaBrowser.Common.Net
|
|||||||
/// <returns>Task{Stream}.</returns>
|
/// <returns>Task{Stream}.</returns>
|
||||||
Task<Stream> Get(string url, CancellationToken cancellationToken);
|
Task<Stream> Get(string url, CancellationToken cancellationToken);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the specified options.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="options">The options.</param>
|
||||||
|
/// <returns>Task{Stream}.</returns>
|
||||||
|
Task<Stream> Get(HttpRequestOptions options);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Performs a POST request
|
/// Performs a POST request
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -161,7 +161,14 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (var json = await httpClient.Get(String.Format(TmdbConfigUrl, ApiKey), Current.MovieDbResourcePool, CancellationToken.None).ConfigureAwait(false))
|
using (var json = await httpClient.Get(new HttpRequestOptions
|
||||||
|
{
|
||||||
|
Url = string.Format(TmdbConfigUrl, ApiKey),
|
||||||
|
CancellationToken = CancellationToken.None,
|
||||||
|
ResourcePool = Current.MovieDbResourcePool,
|
||||||
|
AcceptHeader = AcceptHeader
|
||||||
|
|
||||||
|
}).ConfigureAwait(false))
|
||||||
{
|
{
|
||||||
return jsonSerializer.DeserializeFromStream<TmdbSettingsResult>(json);
|
return jsonSerializer.DeserializeFromStream<TmdbSettingsResult>(json);
|
||||||
}
|
}
|
||||||
@ -246,7 +253,8 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||||||
private const string CastInfo = @"http://api.themoviedb.org/3/movie/{0}/casts?api_key={1}";
|
private const string CastInfo = @"http://api.themoviedb.org/3/movie/{0}/casts?api_key={1}";
|
||||||
private const string ReleaseInfo = @"http://api.themoviedb.org/3/movie/{0}/releases?api_key={1}";
|
private const string ReleaseInfo = @"http://api.themoviedb.org/3/movie/{0}/releases?api_key={1}";
|
||||||
private const string GetImages = @"http://api.themoviedb.org/3/{2}/{0}/images?api_key={1}";
|
private const string GetImages = @"http://api.themoviedb.org/3/{2}/{0}/images?api_key={1}";
|
||||||
public static string ApiKey = "f6bd687ffa63cd282b6ff2c6877f2669";
|
internal static string ApiKey = "f6bd687ffa63cd282b6ff2c6877f2669";
|
||||||
|
internal static string AcceptHeader = "application/json,image/*";
|
||||||
|
|
||||||
static readonly Regex[] NameMatches = new[] {
|
static readonly Regex[] NameMatches = new[] {
|
||||||
new Regex(@"(?<name>.*)\((?<year>\d{4})\)"), // matches "My Movie (2001)" and gives us the name and the year
|
new Regex(@"(?<name>.*)\((?<year>\d{4})\)"), // matches "My Movie (2001)" and gives us the name and the year
|
||||||
@ -504,7 +512,14 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (Stream json = await HttpClient.Get(url3, MovieDbResourcePool, cancellationToken).ConfigureAwait(false))
|
using (Stream json = await HttpClient.Get(new HttpRequestOptions
|
||||||
|
{
|
||||||
|
Url = url3,
|
||||||
|
CancellationToken = cancellationToken,
|
||||||
|
ResourcePool = Current.MovieDbResourcePool,
|
||||||
|
AcceptHeader = AcceptHeader
|
||||||
|
|
||||||
|
}).ConfigureAwait(false))
|
||||||
{
|
{
|
||||||
searchResult = JsonSerializer.DeserializeFromStream<TmdbMovieSearchResults>(json);
|
searchResult = JsonSerializer.DeserializeFromStream<TmdbMovieSearchResults>(json);
|
||||||
}
|
}
|
||||||
@ -536,7 +551,14 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (var json = await HttpClient.Get(url3, MovieDbResourcePool, cancellationToken).ConfigureAwait(false))
|
using (var json = await HttpClient.Get(new HttpRequestOptions
|
||||||
|
{
|
||||||
|
Url = url3,
|
||||||
|
CancellationToken = cancellationToken,
|
||||||
|
ResourcePool = Current.MovieDbResourcePool,
|
||||||
|
AcceptHeader = AcceptHeader
|
||||||
|
|
||||||
|
}).ConfigureAwait(false))
|
||||||
{
|
{
|
||||||
searchResult = JsonSerializer.DeserializeFromStream<TmdbMovieSearchResults>(json);
|
searchResult = JsonSerializer.DeserializeFromStream<TmdbMovieSearchResults>(json);
|
||||||
}
|
}
|
||||||
@ -575,7 +597,14 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (var json = await HttpClient.Get(url3, MovieDbResourcePool, cancellationToken).ConfigureAwait(false))
|
using (var json = await HttpClient.Get(new HttpRequestOptions
|
||||||
|
{
|
||||||
|
Url = url3,
|
||||||
|
CancellationToken = cancellationToken,
|
||||||
|
ResourcePool = Current.MovieDbResourcePool,
|
||||||
|
AcceptHeader = AcceptHeader
|
||||||
|
|
||||||
|
}).ConfigureAwait(false))
|
||||||
{
|
{
|
||||||
var response = JsonSerializer.DeserializeFromStream<TmdbAltTitleResults>(json);
|
var response = JsonSerializer.DeserializeFromStream<TmdbAltTitleResults>(json);
|
||||||
|
|
||||||
@ -657,7 +686,14 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (Stream json = await HttpClient.Get(url, MovieDbResourcePool, cancellationToken).ConfigureAwait(false))
|
using (Stream json = await HttpClient.Get(new HttpRequestOptions
|
||||||
|
{
|
||||||
|
Url = url,
|
||||||
|
CancellationToken = cancellationToken,
|
||||||
|
ResourcePool = Current.MovieDbResourcePool,
|
||||||
|
AcceptHeader = AcceptHeader
|
||||||
|
|
||||||
|
}).ConfigureAwait(false))
|
||||||
{
|
{
|
||||||
var movieResult = JsonSerializer.DeserializeFromStream<CompleteMovieData>(json);
|
var movieResult = JsonSerializer.DeserializeFromStream<CompleteMovieData>(json);
|
||||||
|
|
||||||
@ -758,7 +794,14 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (var json = await HttpClient.Get(url, MovieDbResourcePool, cancellationToken).ConfigureAwait(false))
|
using (var json = await HttpClient.Get(new HttpRequestOptions
|
||||||
|
{
|
||||||
|
Url = url,
|
||||||
|
CancellationToken = cancellationToken,
|
||||||
|
ResourcePool = Current.MovieDbResourcePool,
|
||||||
|
AcceptHeader = AcceptHeader
|
||||||
|
|
||||||
|
}).ConfigureAwait(false))
|
||||||
{
|
{
|
||||||
mainResult = JsonSerializer.DeserializeFromStream<CompleteMovieData>(json);
|
mainResult = JsonSerializer.DeserializeFromStream<CompleteMovieData>(json);
|
||||||
}
|
}
|
||||||
@ -790,7 +833,14 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (Stream json = await HttpClient.Get(url, MovieDbResourcePool, cancellationToken).ConfigureAwait(false))
|
using (Stream json = await HttpClient.Get(new HttpRequestOptions
|
||||||
|
{
|
||||||
|
Url = url,
|
||||||
|
CancellationToken = cancellationToken,
|
||||||
|
ResourcePool = Current.MovieDbResourcePool,
|
||||||
|
AcceptHeader = AcceptHeader
|
||||||
|
|
||||||
|
}).ConfigureAwait(false))
|
||||||
{
|
{
|
||||||
mainResult = JsonSerializer.DeserializeFromStream<CompleteMovieData>(json);
|
mainResult = JsonSerializer.DeserializeFromStream<CompleteMovieData>(json);
|
||||||
}
|
}
|
||||||
@ -826,7 +876,14 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (Stream json = await HttpClient.Get(url, MovieDbResourcePool, cancellationToken).ConfigureAwait(false))
|
using (Stream json = await HttpClient.Get(new HttpRequestOptions
|
||||||
|
{
|
||||||
|
Url = url,
|
||||||
|
CancellationToken = cancellationToken,
|
||||||
|
ResourcePool = Current.MovieDbResourcePool,
|
||||||
|
AcceptHeader = AcceptHeader
|
||||||
|
|
||||||
|
}).ConfigureAwait(false))
|
||||||
{
|
{
|
||||||
cast = JsonSerializer.DeserializeFromStream<TmdbCastResult>(json);
|
cast = JsonSerializer.DeserializeFromStream<TmdbCastResult>(json);
|
||||||
}
|
}
|
||||||
@ -853,7 +910,14 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (Stream json = await HttpClient.Get(url, MovieDbResourcePool, cancellationToken).ConfigureAwait(false))
|
using (Stream json = await HttpClient.Get(new HttpRequestOptions
|
||||||
|
{
|
||||||
|
Url = url,
|
||||||
|
CancellationToken = cancellationToken,
|
||||||
|
ResourcePool = Current.MovieDbResourcePool,
|
||||||
|
AcceptHeader = AcceptHeader
|
||||||
|
|
||||||
|
}).ConfigureAwait(false))
|
||||||
{
|
{
|
||||||
releases = JsonSerializer.DeserializeFromStream<TmdbReleasesResult>(json);
|
releases = JsonSerializer.DeserializeFromStream<TmdbReleasesResult>(json);
|
||||||
}
|
}
|
||||||
@ -882,7 +946,14 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (Stream json = await HttpClient.Get(url, MovieDbResourcePool, cancellationToken).ConfigureAwait(false))
|
using (Stream json = await HttpClient.Get(new HttpRequestOptions
|
||||||
|
{
|
||||||
|
Url = url,
|
||||||
|
CancellationToken = cancellationToken,
|
||||||
|
ResourcePool = Current.MovieDbResourcePool,
|
||||||
|
AcceptHeader = AcceptHeader
|
||||||
|
|
||||||
|
}).ConfigureAwait(false))
|
||||||
{
|
{
|
||||||
images = JsonSerializer.DeserializeFromStream<TmdbImages>(json);
|
images = JsonSerializer.DeserializeFromStream<TmdbImages>(json);
|
||||||
}
|
}
|
||||||
|
@ -163,7 +163,14 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (Stream json = await HttpClient.Get(url, MovieDbProvider.Current.MovieDbResourcePool, cancellationToken).ConfigureAwait(false))
|
using (Stream json = await HttpClient.Get(new HttpRequestOptions
|
||||||
|
{
|
||||||
|
Url = url,
|
||||||
|
CancellationToken = cancellationToken,
|
||||||
|
ResourcePool = MovieDbProvider.Current.MovieDbResourcePool,
|
||||||
|
AcceptHeader = MovieDbProvider.AcceptHeader
|
||||||
|
|
||||||
|
}).ConfigureAwait(false))
|
||||||
{
|
{
|
||||||
searchResult = JsonSerializer.DeserializeFromStream<PersonSearchResults>(json);
|
searchResult = JsonSerializer.DeserializeFromStream<PersonSearchResults>(json);
|
||||||
}
|
}
|
||||||
@ -189,7 +196,14 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (Stream json = await HttpClient.Get(url, MovieDbProvider.Current.MovieDbResourcePool, cancellationToken).ConfigureAwait(false))
|
using (Stream json = await HttpClient.Get(new HttpRequestOptions
|
||||||
|
{
|
||||||
|
Url = url,
|
||||||
|
CancellationToken = cancellationToken,
|
||||||
|
ResourcePool = MovieDbProvider.Current.MovieDbResourcePool,
|
||||||
|
AcceptHeader = MovieDbProvider.AcceptHeader
|
||||||
|
|
||||||
|
}).ConfigureAwait(false))
|
||||||
{
|
{
|
||||||
if (json != null)
|
if (json != null)
|
||||||
{
|
{
|
||||||
@ -267,7 +281,14 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (Stream json = await HttpClient.Get(url, MovieDbProvider.Current.MovieDbResourcePool, cancellationToken).ConfigureAwait(false))
|
using (Stream json = await HttpClient.Get(new HttpRequestOptions
|
||||||
|
{
|
||||||
|
Url = url,
|
||||||
|
CancellationToken = cancellationToken,
|
||||||
|
ResourcePool = MovieDbProvider.Current.MovieDbResourcePool,
|
||||||
|
AcceptHeader = MovieDbProvider.AcceptHeader
|
||||||
|
|
||||||
|
}).ConfigureAwait(false))
|
||||||
{
|
{
|
||||||
if (json != null)
|
if (json != null)
|
||||||
{
|
{
|
||||||
|
@ -22,10 +22,10 @@ namespace MediaBrowser.Model.Dto
|
|||||||
/// <value>The series count.</value>
|
/// <value>The series count.</value>
|
||||||
public int SeriesCount { get; set; }
|
public int SeriesCount { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the episode guest star count.
|
/// Gets or sets the episode count.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The episode guest star count.</value>
|
/// <value>The episode count.</value>
|
||||||
public int EpisodeGuestStarCount { get; set; }
|
public int EpisodeCount { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the game count.
|
/// Gets or sets the game count.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user