mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-16 04:30:24 +01:00
re-factored some file system access
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user