add httpClient to appropriate constructors

This commit is contained in:
William Lees 2019-02-12 00:24:00 +11:00
parent eb4b705167
commit d8cb34dbbc
5 changed files with 19 additions and 5 deletions

View File

@ -71,7 +71,7 @@ namespace MediaBrowser.Api.Playback
protected IMediaSourceManager MediaSourceManager { get; private set; }
protected IJsonSerializer JsonSerializer { get; private set; }
public static IHttpClient HttpClient;
public static IHttpClient HttpClient { get; private set; }
protected IAuthorizationContext AuthorizationContext { get; private set; }
protected EncodingHelper EncodingHelper { get; set; }
@ -80,6 +80,7 @@ namespace MediaBrowser.Api.Playback
/// Initializes a new instance of the <see cref="BaseStreamingService" /> class.
/// </summary>
protected BaseStreamingService(
IHttpClient httpClient,
IServerConfigurationManager serverConfig,
IUserManager userManager,
ILibraryManager libraryManager,
@ -93,6 +94,7 @@ namespace MediaBrowser.Api.Playback
IJsonSerializer jsonSerializer,
IAuthorizationContext authorizationContext)
{
HttpClient = httpClient;
ServerConfigurationManager = serverConfig;
UserManager = userManager;
LibraryManager = libraryManager;

View File

@ -1,4 +1,5 @@
using System.Threading.Tasks;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Devices;
using MediaBrowser.Controller.Dlna;
@ -33,6 +34,7 @@ namespace MediaBrowser.Api.Playback.Progressive
public class AudioService : BaseProgressiveStreamingService
{
public AudioService(
IHttpClient httpClient,
IServerConfigurationManager serverConfig,
IUserManager userManager,
ILibraryManager libraryManager,
@ -46,7 +48,8 @@ namespace MediaBrowser.Api.Playback.Progressive
IJsonSerializer jsonSerializer,
IAuthorizationContext authorizationContext,
IEnvironmentInfo environmentInfo)
: base(serverConfig,
: base(httpClient,
serverConfig,
userManager,
libraryManager,
isoManager,

View File

@ -28,6 +28,7 @@ namespace MediaBrowser.Api.Playback.Progressive
protected readonly IEnvironmentInfo EnvironmentInfo;
public BaseProgressiveStreamingService(
IHttpClient httpClient,
IServerConfigurationManager serverConfig,
IUserManager userManager,
ILibraryManager libraryManager,
@ -41,7 +42,8 @@ namespace MediaBrowser.Api.Playback.Progressive
IJsonSerializer jsonSerializer,
IAuthorizationContext authorizationContext,
IEnvironmentInfo environmentInfo)
: base(serverConfig,
: base(httpClient,
serverConfig,
userManager,
libraryManager,
isoManager,

View File

@ -1,4 +1,5 @@
using System.Threading.Tasks;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Devices;
using MediaBrowser.Controller.Dlna;
@ -69,6 +70,7 @@ namespace MediaBrowser.Api.Playback.Progressive
public class VideoService : BaseProgressiveStreamingService
{
public VideoService(
IHttpClient httpClient,
IServerConfigurationManager serverConfig,
IUserManager userManager,
ILibraryManager libraryManager,
@ -82,7 +84,8 @@ namespace MediaBrowser.Api.Playback.Progressive
IJsonSerializer jsonSerializer,
IAuthorizationContext authorizationContext,
IEnvironmentInfo environmentInfo)
: base(serverConfig,
: base(httpClient,
serverConfig,
userManager,
libraryManager,
isoManager,

View File

@ -77,6 +77,7 @@ namespace MediaBrowser.Api.Playback
public class UniversalAudioService : BaseApiService
{
public UniversalAudioService(
IHttpClient httpClient,
IServerConfigurationManager serverConfigurationManager,
IUserManager userManager,
ILibraryManager libraryManager,
@ -95,6 +96,7 @@ namespace MediaBrowser.Api.Playback
IEnvironmentInfo environmentInfo,
ILoggerFactory loggerFactory)
{
HttpClient = httpClient;
ServerConfigurationManager = serverConfigurationManager;
UserManager = userManager;
LibraryManager = libraryManager;
@ -115,6 +117,7 @@ namespace MediaBrowser.Api.Playback
_logger = loggerFactory.CreateLogger(nameof(UniversalAudioService));
}
protected IHttpClient HttpClient { get; private set; }
protected IServerConfigurationManager ServerConfigurationManager { get; private set; }
protected IUserManager UserManager { get; private set; }
protected ILibraryManager LibraryManager { get; private set; }
@ -323,7 +326,8 @@ namespace MediaBrowser.Api.Playback
}
else
{
var service = new AudioService(ServerConfigurationManager,
var service = new AudioService(HttpClient,
ServerConfigurationManager,
UserManager,
LibraryManager,
IsoManager,