aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.MediaEncoding/Subtitles/SubtitleEditParser.cs
diff options
context:
space:
mode:
authorƁukasz <gold15o2@gmail.com>2024-09-06 15:47:06 +0200
committerGitHub <noreply@github.com>2024-09-06 07:47:06 -0600
commit1451cbc39e16b79c3be636bdb8919a66ff636cba (patch)
tree601927fe73a3960905d950c25ea4d3abb9d8200e /MediaBrowser.MediaEncoding/Subtitles/SubtitleEditParser.cs
parentcd95eabcc6756c84eddf6a6b8fd9a8eea2a5b5ab (diff)
Add subtitle parser errors to log if available (#12479)
Diffstat (limited to 'MediaBrowser.MediaEncoding/Subtitles/SubtitleEditParser.cs')
-rw-r--r--MediaBrowser.MediaEncoding/Subtitles/SubtitleEditParser.cs23
1 files changed, 17 insertions, 6 deletions
diff --git a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEditParser.cs b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEditParser.cs
index fd55db4ba..a79d801fb 100644
--- a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEditParser.cs
+++ b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEditParser.cs
@@ -54,12 +54,23 @@ namespace MediaBrowser.MediaEncoding.Subtitles
{
break;
}
-
- _logger.LogError(
- "{ErrorCount} errors encountered while parsing '{FileExtension}' subtitle using the {SubtitleFormatParser} format parser",
- subtitleFormat.ErrorCount,
- fileExtension,
- subtitleFormat.Name);
+ else if (subtitleFormat.TryGetErrors(out var errors))
+ {
+ _logger.LogError(
+ "{ErrorCount} errors encountered while parsing '{FileExtension}' subtitle using the {SubtitleFormatParser} format parser, errors: {Errors}",
+ subtitleFormat.ErrorCount,
+ fileExtension,
+ subtitleFormat.Name,
+ errors);
+ }
+ else
+ {
+ _logger.LogError(
+ "{ErrorCount} errors encountered while parsing '{FileExtension}' subtitle using the {SubtitleFormatParser} format parser",
+ subtitleFormat.ErrorCount,
+ fileExtension,
+ subtitleFormat.Name);
+ }
}
if (subtitle.Paragraphs.Count == 0)