aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Playback/Hls/HlsSegmentService.cs
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2019-12-18 11:53:41 +0100
committerBond-009 <bond.009@outlook.com>2019-12-18 11:53:41 +0100
commita1ca50fd5a74eafa6e609976d90cad42b54137e5 (patch)
tree9c64d6914c27a8d7e2f8e6f71d7a5952197705cf /MediaBrowser.Api/Playback/Hls/HlsSegmentService.cs
parent8723bdbb4fb73ed261ac1ba3b6932773e523d78b (diff)
parent6b185119aa329764c1ccc57d9be3e81f05680b69 (diff)
Merge branch 'namingtests' of https://github.com/Bond-009/jellyfin into namingtests
Diffstat (limited to 'MediaBrowser.Api/Playback/Hls/HlsSegmentService.cs')
-rw-r--r--MediaBrowser.Api/Playback/Hls/HlsSegmentService.cs17
1 files changed, 11 insertions, 6 deletions
diff --git a/MediaBrowser.Api/Playback/Hls/HlsSegmentService.cs b/MediaBrowser.Api/Playback/Hls/HlsSegmentService.cs
index ca5a73ff1..bb12ab1f0 100644
--- a/MediaBrowser.Api/Playback/Hls/HlsSegmentService.cs
+++ b/MediaBrowser.Api/Playback/Hls/HlsSegmentService.cs
@@ -8,6 +8,7 @@ using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Controller.Net;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Services;
+using Microsoft.Extensions.Logging;
namespace MediaBrowser.Api.Playback.Hls
{
@@ -83,19 +84,22 @@ namespace MediaBrowser.Api.Playback.Hls
public class HlsSegmentService : BaseApiService
{
- private readonly IServerConfigurationManager _config;
private readonly IFileSystem _fileSystem;
- public HlsSegmentService(IServerConfigurationManager config, IFileSystem fileSystem)
+ public HlsSegmentService(
+ ILogger<HlsSegmentService> logger,
+ IServerConfigurationManager serverConfigurationManager,
+ IHttpResultFactory httpResultFactory,
+ IFileSystem fileSystem)
+ : base(logger, serverConfigurationManager, httpResultFactory)
{
- _config = config;
_fileSystem = fileSystem;
}
public Task<object> Get(GetHlsPlaylistLegacy request)
{
var file = request.PlaylistId + Path.GetExtension(Request.PathInfo);
- file = Path.Combine(_config.GetTranscodePath(), file);
+ file = Path.Combine(ServerConfigurationManager.GetTranscodePath(), file);
return GetFileResult(file, file);
}
@@ -113,7 +117,8 @@ namespace MediaBrowser.Api.Playback.Hls
public Task<object> Get(GetHlsVideoSegmentLegacy request)
{
var file = request.SegmentId + Path.GetExtension(Request.PathInfo);
- var transcodeFolderPath = _config.GetTranscodePath();
+ var transcodeFolderPath = ServerConfigurationManager.GetTranscodePath();
+
file = Path.Combine(transcodeFolderPath, file);
var normalizedPlaylistId = request.PlaylistId;
@@ -133,7 +138,7 @@ namespace MediaBrowser.Api.Playback.Hls
{
// TODO: Deprecate with new iOS app
var file = request.SegmentId + Path.GetExtension(Request.PathInfo);
- file = Path.Combine(_config.GetTranscodePath(), file);
+ file = Path.Combine(ServerConfigurationManager.GetTranscodePath(), file);
return ResultFactory.GetStaticFileResult(Request, file, FileShareMode.ReadWrite);
}