|  |  | 1 |  | using System.Diagnostics.CodeAnalysis; | 
|  |  | 2 |  | using Nikse.SubtitleEdit.Core.SubtitleFormats; | 
|  |  | 3 |  |  | 
|  |  | 4 |  | namespace MediaBrowser.MediaEncoding.Subtitles; | 
|  |  | 5 |  |  | 
|  |  | 6 |  | internal static class SubtitleFormatExtensions | 
|  |  | 7 |  | { | 
|  |  | 8 |  |     /// <summary> | 
|  |  | 9 |  |     /// Will try to find errors if supported by provider. | 
|  |  | 10 |  |     /// </summary> | 
|  |  | 11 |  |     /// <param name="format">The subtitle format.</param> | 
|  |  | 12 |  |     /// <param name="errors">The out errors value.</param> | 
|  |  | 13 |  |     /// <returns>True if errors are available for given format.</returns> | 
|  |  | 14 |  |     public static bool TryGetErrors(this SubtitleFormat format, [NotNullWhen(true)] out string? errors) | 
|  |  | 15 |  |     { | 
|  | 0 | 16 |  |         errors = format switch | 
|  | 0 | 17 |  |         { | 
|  | 0 | 18 |  |             SubStationAlpha ssa => ssa.Errors, | 
|  | 0 | 19 |  |             AdvancedSubStationAlpha assa => assa.Errors, | 
|  | 0 | 20 |  |             SubRip subRip => subRip.Errors, | 
|  | 0 | 21 |  |             MicroDvd microDvd => microDvd.Errors, | 
|  | 0 | 22 |  |             DCinemaSmpte2007 smpte2007 => smpte2007.Errors, | 
|  | 0 | 23 |  |             DCinemaSmpte2010 smpte2010 => smpte2010.Errors, | 
|  | 0 | 24 |  |             _ => null, | 
|  | 0 | 25 |  |         }; | 
|  |  | 26 |  |  | 
|  | 0 | 27 |  |         return !string.IsNullOrWhiteSpace(errors); | 
|  |  | 28 |  |     } | 
|  |  | 29 |  | } |