defer path creation when possible

This commit is contained in:
Luke Pulverenti
2013-06-04 12:48:23 -04:00
parent 02fedead11
commit 2e408e40c0
7 changed files with 38 additions and 233 deletions

View File

@@ -562,6 +562,13 @@ namespace MediaBrowser.Api.Playback
/// <returns>Task.</returns>
protected async Task StartFfMpeg(StreamState state, string outputPath)
{
var parentPath = Path.GetDirectoryName(outputPath);
if (!Directory.Exists(parentPath))
{
Directory.CreateDirectory(parentPath);
}
var video = state.Item as Video;
if (video != null && video.VideoType == VideoType.Iso && video.IsoType.HasValue && IsoManager.CanMount(video.Path))