Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/jellyfin/commit/78f437401b836edc8fc535eb5d46506e58a64329 You should set ROOT_URL correctly, otherwise the web may not work correctly.

loop over all compatible SubtitleFormats

pull/8087/head
cvium 3 years ago
parent 1db748399c
commit 78f437401b

@ -30,17 +30,23 @@ namespace MediaBrowser.MediaEncoding.Subtitles
/// <inheritdoc />
public SubtitleTrackInfo Parse(Stream stream, string fileExtension)
{
var subtitleFormat = SubtitleFormat.AllSubtitleFormats.FirstOrDefault(asf => asf.Extension.Equals(fileExtension, StringComparison.OrdinalIgnoreCase));
if (subtitleFormat == null)
{
throw new ArgumentException("Unsupported format: " + fileExtension);
}
var lines = stream.ReadAllLines().ToList();
var subtitle = new Subtitle();
subtitleFormat.LoadSubtitle(subtitle, lines, fileExtension);
if (subtitleFormat.ErrorCount > 0)
var lines = stream.ReadAllLines().ToList();
var subtitleFormats = SubtitleFormat.AllSubtitleFormats.Where(asf => asf.Extension.Equals(fileExtension, StringComparison.OrdinalIgnoreCase));
foreach (var subtitleFormat in subtitleFormats)
{
if (subtitleFormat == null)
{
throw new ArgumentException("Unsupported format: " + fileExtension);
}
subtitleFormat.LoadSubtitle(subtitle, lines, fileExtension);
if (subtitleFormat.ErrorCount == 0)
{
break;
}
_logger.LogError("{ErrorCount} errors encountered while parsing subtitle", subtitleFormat.ErrorCount);
}

Loading…
Cancel
Save