diff options
| author | Ćukasz <gold15o2@gmail.com> | 2024-09-06 15:47:06 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-06 07:47:06 -0600 |
| commit | 1451cbc39e16b79c3be636bdb8919a66ff636cba (patch) | |
| tree | 601927fe73a3960905d950c25ea4d3abb9d8200e /MediaBrowser.MediaEncoding/Subtitles/SubtitleEditParser.cs | |
| parent | cd95eabcc6756c84eddf6a6b8fd9a8eea2a5b5ab (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.cs | 23 |
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) |
