diff options
Diffstat (limited to 'MediaBrowser.Api/LiveTv/LiveTvService.cs')
| -rw-r--r-- | MediaBrowser.Api/LiveTv/LiveTvService.cs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/MediaBrowser.Api/LiveTv/LiveTvService.cs b/MediaBrowser.Api/LiveTv/LiveTvService.cs index 9fcdb4be5..837a0f6a6 100644 --- a/MediaBrowser.Api/LiveTv/LiveTvService.cs +++ b/MediaBrowser.Api/LiveTv/LiveTvService.cs @@ -17,11 +17,12 @@ using System.Threading; using System.Threading.Tasks; using MediaBrowser.Model.IO; using MediaBrowser.Api.Playback.Progressive; -using MediaBrowser.Common.IO; + using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Entities.TV; using MediaBrowser.Controller.IO; using MediaBrowser.Model.Services; +using MediaBrowser.Model.System; namespace MediaBrowser.Api.LiveTv { @@ -698,8 +699,9 @@ namespace MediaBrowser.Api.LiveTv private readonly IFileSystem _fileSystem; private readonly IAuthorizationContext _authContext; private readonly ISessionContext _sessionContext; + private readonly IEnvironmentInfo _environment; - public LiveTvService(ILiveTvManager liveTvManager, IUserManager userManager, IServerConfigurationManager config, IHttpClient httpClient, ILibraryManager libraryManager, IDtoService dtoService, IFileSystem fileSystem, IAuthorizationContext authContext, ISessionContext sessionContext) + public LiveTvService(ILiveTvManager liveTvManager, IUserManager userManager, IServerConfigurationManager config, IHttpClient httpClient, ILibraryManager libraryManager, IDtoService dtoService, IFileSystem fileSystem, IAuthorizationContext authContext, ISessionContext sessionContext, IEnvironmentInfo environment) { _liveTvManager = liveTvManager; _userManager = userManager; @@ -710,6 +712,7 @@ namespace MediaBrowser.Api.LiveTv _fileSystem = fileSystem; _authContext = authContext; _sessionContext = sessionContext; + _environment = environment; } public object Get(GetTunerHostTypes request) @@ -731,7 +734,7 @@ namespace MediaBrowser.Api.LiveTv outputHeaders["Content-Type"] = Model.Net.MimeTypes.GetMimeType(path); - return new ProgressiveFileCopier(_fileSystem, path, outputHeaders, null, Logger, CancellationToken.None) + return new ProgressiveFileCopier(_fileSystem, path, outputHeaders, null, Logger, _environment, CancellationToken.None) { AllowEndOfFile = false }; @@ -750,7 +753,7 @@ namespace MediaBrowser.Api.LiveTv outputHeaders["Content-Type"] = Model.Net.MimeTypes.GetMimeType("file." + request.Container); - return new ProgressiveFileCopier(directStreamProvider, outputHeaders, null, Logger, CancellationToken.None) + return new ProgressiveFileCopier(directStreamProvider, outputHeaders, null, Logger, _environment, CancellationToken.None) { AllowEndOfFile = false }; @@ -889,6 +892,8 @@ namespace MediaBrowser.Api.LiveTv public async Task<object> Get(GetChannels request) { + var options = GetDtoOptions(_authContext, request); + var channelResult = await _liveTvManager.GetInternalChannels(new LiveTvChannelQuery { ChannelType = request.Type, @@ -908,11 +913,10 @@ namespace MediaBrowser.Api.LiveTv SortOrder = request.SortOrder ?? SortOrder.Ascending, AddCurrentProgram = request.AddCurrentProgram - }, CancellationToken.None).ConfigureAwait(false); + }, options, CancellationToken.None).ConfigureAwait(false); var user = string.IsNullOrEmpty(request.UserId) ? null : _userManager.GetUserById(request.UserId); - var options = GetDtoOptions(_authContext, request); RemoveFields(options); options.AddCurrentProgram = request.AddCurrentProgram; |
