diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-06-03 22:02:49 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-06-03 22:02:49 -0400 |
| commit | 02fedead11f738c09e503c3bdc74e2dd98e21cc8 (patch) | |
| tree | 5e32fb80c23fa910dbdd0cc6a8be6bf105abd631 /MediaBrowser.Api/Playback/BaseStreamingService.cs | |
| parent | 08d9004d8f361aaf13756cab70fc659e5fbb775c (diff) | |
re-factored some file system access
Diffstat (limited to 'MediaBrowser.Api/Playback/BaseStreamingService.cs')
| -rw-r--r-- | MediaBrowser.Api/Playback/BaseStreamingService.cs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 8b07145de..9d5f73141 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -340,6 +340,13 @@ namespace MediaBrowser.Api.Playback try { + var parentPath = Path.GetDirectoryName(path); + + if (!Directory.Exists(parentPath)) + { + Directory.CreateDirectory(parentPath); + } + var task = MediaEncoder.ExtractTextSubtitle(inputPath, type, subtitleStream.Index, offset, path, CancellationToken.None); Task.WaitAll(task); @@ -371,6 +378,13 @@ namespace MediaBrowser.Api.Playback { try { + var parentPath = Path.GetDirectoryName(path); + + if (!Directory.Exists(parentPath)) + { + Directory.CreateDirectory(parentPath); + } + var task = MediaEncoder.ConvertTextSubtitleToAss(subtitleStream.Path, path, offset, CancellationToken.None); Task.WaitAll(task); |
