|
@@ -2,7 +2,7 @@ using System;
|
|
using System.IO;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using System.Threading.Tasks;
|
|
-using MediaBrowser.Controller;
|
|
|
|
|
|
+using MediaBrowser.Common.Configuration;
|
|
using MediaBrowser.Controller.Configuration;
|
|
using MediaBrowser.Controller.Configuration;
|
|
using MediaBrowser.Controller.MediaEncoding;
|
|
using MediaBrowser.Controller.MediaEncoding;
|
|
using MediaBrowser.Controller.Net;
|
|
using MediaBrowser.Controller.Net;
|
|
@@ -83,13 +83,11 @@ namespace MediaBrowser.Api.Playback.Hls
|
|
|
|
|
|
public class HlsSegmentService : BaseApiService
|
|
public class HlsSegmentService : BaseApiService
|
|
{
|
|
{
|
|
- private readonly IServerApplicationPaths _appPaths;
|
|
|
|
private readonly IServerConfigurationManager _config;
|
|
private readonly IServerConfigurationManager _config;
|
|
private readonly IFileSystem _fileSystem;
|
|
private readonly IFileSystem _fileSystem;
|
|
|
|
|
|
- public HlsSegmentService(IServerApplicationPaths appPaths, IServerConfigurationManager config, IFileSystem fileSystem)
|
|
|
|
|
|
+ public HlsSegmentService(IServerConfigurationManager config, IFileSystem fileSystem)
|
|
{
|
|
{
|
|
- _appPaths = appPaths;
|
|
|
|
_config = config;
|
|
_config = config;
|
|
_fileSystem = fileSystem;
|
|
_fileSystem = fileSystem;
|
|
}
|
|
}
|
|
@@ -97,7 +95,7 @@ namespace MediaBrowser.Api.Playback.Hls
|
|
public Task<object> Get(GetHlsPlaylistLegacy request)
|
|
public Task<object> Get(GetHlsPlaylistLegacy request)
|
|
{
|
|
{
|
|
var file = request.PlaylistId + Path.GetExtension(Request.PathInfo);
|
|
var file = request.PlaylistId + Path.GetExtension(Request.PathInfo);
|
|
- file = Path.Combine(_appPaths.TranscodePath, file);
|
|
|
|
|
|
+ file = Path.Combine(_config.GetTranscodePath(), file);
|
|
|
|
|
|
return GetFileResult(file, file);
|
|
return GetFileResult(file, file);
|
|
}
|
|
}
|
|
@@ -115,8 +113,7 @@ namespace MediaBrowser.Api.Playback.Hls
|
|
public Task<object> Get(GetHlsVideoSegmentLegacy request)
|
|
public Task<object> Get(GetHlsVideoSegmentLegacy request)
|
|
{
|
|
{
|
|
var file = request.SegmentId + Path.GetExtension(Request.PathInfo);
|
|
var file = request.SegmentId + Path.GetExtension(Request.PathInfo);
|
|
-
|
|
|
|
- var transcodeFolderPath = _config.ApplicationPaths.TranscodePath;
|
|
|
|
|
|
+ var transcodeFolderPath = _config.GetTranscodePath();
|
|
file = Path.Combine(transcodeFolderPath, file);
|
|
file = Path.Combine(transcodeFolderPath, file);
|
|
|
|
|
|
var normalizedPlaylistId = request.PlaylistId;
|
|
var normalizedPlaylistId = request.PlaylistId;
|
|
@@ -136,7 +133,7 @@ namespace MediaBrowser.Api.Playback.Hls
|
|
{
|
|
{
|
|
// TODO: Deprecate with new iOS app
|
|
// TODO: Deprecate with new iOS app
|
|
var file = request.SegmentId + Path.GetExtension(Request.PathInfo);
|
|
var file = request.SegmentId + Path.GetExtension(Request.PathInfo);
|
|
- file = Path.Combine(_appPaths.TranscodePath, file);
|
|
|
|
|
|
+ file = Path.Combine(_config.GetTranscodePath(), file);
|
|
|
|
|
|
return ResultFactory.GetStaticFileResult(Request, file, FileShareMode.ReadWrite);
|
|
return ResultFactory.GetStaticFileResult(Request, file, FileShareMode.ReadWrite);
|
|
}
|
|
}
|