rework settings page

This commit is contained in:
Luke Pulverenti
2015-07-28 15:42:24 -04:00
parent 713a9e779b
commit d95057f13b
9 changed files with 51 additions and 43 deletions

View File

@@ -53,7 +53,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
}
}
public async Task<Stream> ConvertSubtitles(Stream stream,
private async Task<Stream> ConvertSubtitles(Stream stream,
string inputFormat,
string outputFormat,
long startTimeTicks,
@@ -64,7 +64,9 @@ namespace MediaBrowser.MediaEncoding.Subtitles
try
{
var trackInfo = await GetTrackInfo(stream, inputFormat, cancellationToken).ConfigureAwait(false);
var reader = GetReader(inputFormat, true);
var trackInfo = reader.Parse(stream, cancellationToken);
FilterEvents(trackInfo, startTimeTicks, endTimeTicks, false);
@@ -190,7 +192,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
{
throw new ArgumentNullException("charset");
}
try
{
return Encoding.GetEncoding(charset);
@@ -257,15 +259,6 @@ namespace MediaBrowser.MediaEncoding.Subtitles
return new Tuple<string, MediaProtocol, string, bool>(subtitleStream.Path, protocol, currentFormat, true);
}
private async Task<SubtitleTrackInfo> GetTrackInfo(Stream stream,
string inputFormat,
CancellationToken cancellationToken)
{
var reader = GetReader(inputFormat, true);
return reader.Parse(stream, cancellationToken);
}
private ISubtitleParser GetReader(string format, bool throwIfMissing)
{
if (string.IsNullOrEmpty(format))