fixed hls file deletion

pull/702/head
Luke Pulverenti 12 years ago
parent 7371860871
commit e8634cbafd

@ -1,5 +1,6 @@
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Threading.Tasks;
using MediaBrowser.Common.IO; using MediaBrowser.Common.IO;
using MediaBrowser.Common.MediaInfo; using MediaBrowser.Common.MediaInfo;
using MediaBrowser.Controller; using MediaBrowser.Controller;
@ -67,6 +68,15 @@ namespace MediaBrowser.Api.Playback.Hls
foreach (var playlist in Directory.EnumerateFiles(ApplicationPaths.EncodedMediaCachePath, "*.m3u8").ToList()) foreach (var playlist in Directory.EnumerateFiles(ApplicationPaths.EncodedMediaCachePath, "*.m3u8").ToList())
{ {
ApiEntryPoint.Instance.OnTranscodeBeginRequest(playlist, TranscodingJobType.Hls); ApiEntryPoint.Instance.OnTranscodeBeginRequest(playlist, TranscodingJobType.Hls);
// Avoid implicitly captured closure
var playlist1 = playlist;
Task.Run(async () =>
{
await Task.Delay(2000).ConfigureAwait(false);
ApiEntryPoint.Instance.OnTranscodeEndRequest(playlist1, TranscodingJobType.Hls);
});
} }
var file = SegmentFilePrefix + request.SegmentId + Path.GetExtension(RequestContext.PathInfo); var file = SegmentFilePrefix + request.SegmentId + Path.GetExtension(RequestContext.PathInfo);

Loading…
Cancel
Save