diff --git a/MediaBrowser.Api/AuthorizationRequestFilterAttribute.cs b/MediaBrowser.Api/AuthorizationRequestFilterAttribute.cs
index 8f9babd06a..82df791ded 100644
--- a/MediaBrowser.Api/AuthorizationRequestFilterAttribute.cs
+++ b/MediaBrowser.Api/AuthorizationRequestFilterAttribute.cs
@@ -5,7 +5,6 @@ using MediaBrowser.Model.Logging;
using ServiceStack.Web;
using System;
using System.Collections.Generic;
-using System.Net.Http.Headers;
namespace MediaBrowser.Api
{
diff --git a/MediaBrowser.Api/BaseApiService.cs b/MediaBrowser.Api/BaseApiService.cs
index 8febe4a65d..556f3b57d5 100644
--- a/MediaBrowser.Api/BaseApiService.cs
+++ b/MediaBrowser.Api/BaseApiService.cs
@@ -6,7 +6,6 @@ using MediaBrowser.Model.Logging;
using ServiceStack.Web;
using System;
using System.Collections.Generic;
-using System.IO;
using System.Linq;
namespace MediaBrowser.Api
diff --git a/MediaBrowser.Api/MediaBrowser.Api.csproj b/MediaBrowser.Api/MediaBrowser.Api.csproj
index 409d152f79..a04aca2a03 100644
--- a/MediaBrowser.Api/MediaBrowser.Api.csproj
+++ b/MediaBrowser.Api/MediaBrowser.Api.csproj
@@ -99,7 +99,6 @@
-
diff --git a/MediaBrowser.Api/Playback/Hls/HlsSegmentResponseFilter.cs b/MediaBrowser.Api/Playback/Hls/HlsSegmentResponseFilter.cs
deleted file mode 100644
index 10ea6bc639..0000000000
--- a/MediaBrowser.Api/Playback/Hls/HlsSegmentResponseFilter.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-using MediaBrowser.Controller;
-using MediaBrowser.Model.Logging;
-using ServiceStack.Text.Controller;
-using ServiceStack.Web;
-using System;
-using System.IO;
-using System.Linq;
-
-namespace MediaBrowser.Api.Playback.Hls
-{
- public class HlsSegmentResponseFilter : Attribute, IHasResponseFilter
- {
- public ILogger Logger { get; set; }
- public IServerApplicationPaths ApplicationPaths { get; set; }
-
- public void ResponseFilter(IRequest req, IResponse res, object response)
- {
- var pathInfo = PathInfo.Parse(req.PathInfo);
- var itemId = pathInfo.GetArgumentValue(1);
- var playlistId = pathInfo.GetArgumentValue(3);
-
- OnEndRequest(itemId, playlistId);
- }
-
- public IHasResponseFilter Copy()
- {
- return this;
- }
-
- public int Priority
- {
- get { return -1; }
- }
-
- ///
- /// Called when [end request].
- ///
- /// The item id.
- /// The playlist id.
- protected void OnEndRequest(string itemId, string playlistId)
- {
- Logger.Info("OnEndRequest " + playlistId);
- var normalizedPlaylistId = playlistId.Replace("-low", string.Empty);
-
- foreach (var playlist in Directory.EnumerateFiles(ApplicationPaths.TranscodingTempPath, "*.m3u8")
- .Where(i => i.IndexOf(normalizedPlaylistId, StringComparison.OrdinalIgnoreCase) != -1)
- .ToList())
- {
- ApiEntryPoint.Instance.OnTranscodeEndRequest(playlist, TranscodingJobType.Hls);
- }
- }
- }
-}
diff --git a/MediaBrowser.Api/Playback/Hls/HlsSegmentService.cs b/MediaBrowser.Api/Playback/Hls/HlsSegmentService.cs
index 31583ac197..5d2dd07c7e 100644
--- a/MediaBrowser.Api/Playback/Hls/HlsSegmentService.cs
+++ b/MediaBrowser.Api/Playback/Hls/HlsSegmentService.cs
@@ -28,28 +28,6 @@ namespace MediaBrowser.Api.Playback.Hls
public string SegmentId { get; set; }
}
- ///
- /// Class GetHlsVideoSegment
- ///
- [Route("/Videos/{Id}/hls/{PlaylistId}/{SegmentId}.ts", "GET")]
- [Api(Description = "Gets an Http live streaming segment file. Internal use only.")]
- public class GetHlsVideoSegment
- {
- ///
- /// Gets or sets the id.
- ///
- /// The id.
- public string Id { get; set; }
-
- public string PlaylistId { get; set; }
-
- ///
- /// Gets or sets the segment id.
- ///
- /// The segment id.
- public string SegmentId { get; set; }
- }
-
///
/// Class GetHlsVideoSegment
///
@@ -99,22 +77,6 @@ namespace MediaBrowser.Api.Playback.Hls
ApiEntryPoint.Instance.KillTranscodingJobs(request.DeviceId, true);
}
- ///
- /// Gets the specified request.
- ///
- /// The request.
- /// System.Object.
- public object Get(GetHlsVideoSegment request)
- {
- var file = request.SegmentId + Path.GetExtension(Request.PathInfo);
-
- file = Path.Combine(_appPaths.TranscodingTempPath, file);
-
- OnBeginRequest(request.PlaylistId);
-
- return ResultFactory.GetStaticFileResult(Request, file);
- }
-
///
/// Gets the specified request.
///
diff --git a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs
index fae9e26c62..174cbe9ba0 100644
--- a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs
+++ b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs
@@ -10,6 +10,8 @@ using MediaBrowser.Model.IO;
using ServiceStack;
using System;
using System.Collections.Generic;
+using System.IO;
+using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
@@ -56,6 +58,28 @@ namespace MediaBrowser.Api.Playback.Hls
{
}
+ ///
+ /// Class GetHlsVideoSegment
+ ///
+ [Route("/Videos/{Id}/hls/{PlaylistId}/{SegmentId}.ts", "GET")]
+ [Api(Description = "Gets an Http live streaming segment file. Internal use only.")]
+ public class GetHlsVideoSegment
+ {
+ ///
+ /// Gets or sets the id.
+ ///
+ /// The id.
+ public string Id { get; set; }
+
+ public string PlaylistId { get; set; }
+
+ ///
+ /// Gets or sets the segment id.
+ ///
+ /// The segment id.
+ public string SegmentId { get; set; }
+ }
+
///
/// Class VideoHlsService
///
@@ -87,6 +111,22 @@ namespace MediaBrowser.Api.Playback.Hls
return result;
}
+ ///
+ /// Gets the specified request.
+ ///
+ /// The request.
+ /// System.Object.
+ public object Get(GetHlsVideoSegment request)
+ {
+ var file = request.SegmentId + Path.GetExtension(Request.PathInfo);
+
+ file = Path.Combine(ServerConfigurationManager.ApplicationPaths.TranscodingTempPath, file);
+
+ OnBeginRequest(request.PlaylistId);
+
+ return ResultFactory.GetStaticFileResult(Request, file);
+ }
+
private async Task