Merge pull request #868 from WillWill56/fix_bss

Fix audio streaming via BaseProgressiveStreamingService
pull/886/head
Vasily 6 years ago committed by GitHub
commit 593b7327cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -8,7 +8,6 @@ using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using MediaBrowser.Common.Extensions; using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller; using MediaBrowser.Controller;
using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Devices; using MediaBrowser.Controller.Devices;
@ -71,7 +70,6 @@ namespace MediaBrowser.Api.Playback
protected IMediaSourceManager MediaSourceManager { get; private set; } protected IMediaSourceManager MediaSourceManager { get; private set; }
protected IJsonSerializer JsonSerializer { get; private set; } protected IJsonSerializer JsonSerializer { get; private set; }
public static IHttpClient HttpClient;
protected IAuthorizationContext AuthorizationContext { get; private set; } protected IAuthorizationContext AuthorizationContext { get; private set; }
protected EncodingHelper EncodingHelper { get; set; } protected EncodingHelper EncodingHelper { get; set; }

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

@ -26,8 +26,10 @@ namespace MediaBrowser.Api.Playback.Progressive
public abstract class BaseProgressiveStreamingService : BaseStreamingService public abstract class BaseProgressiveStreamingService : BaseStreamingService
{ {
protected readonly IEnvironmentInfo EnvironmentInfo; protected readonly IEnvironmentInfo EnvironmentInfo;
protected IHttpClient HttpClient { get; private set; }
public BaseProgressiveStreamingService( public BaseProgressiveStreamingService(
IHttpClient httpClient,
IServerConfigurationManager serverConfig, IServerConfigurationManager serverConfig,
IUserManager userManager, IUserManager userManager,
ILibraryManager libraryManager, ILibraryManager libraryManager,
@ -55,6 +57,7 @@ namespace MediaBrowser.Api.Playback.Progressive
authorizationContext) authorizationContext)
{ {
EnvironmentInfo = environmentInfo; EnvironmentInfo = environmentInfo;
HttpClient = httpClient;
} }
/// <summary> /// <summary>

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

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

Loading…
Cancel
Save