af1152b001
Refactored all C# test files to use explicit namespace declarations and moved all using directives inside the namespace block for consistency. Updated assembly info and cache files to reflect the new build. Adjusted MvcTestingAppManifest.json to use fully qualified assembly names. No functional changes; all updates are related to code style, organization, and project metadata.
34 lines
1.2 KiB
C#
34 lines
1.2 KiB
C#
// <copyright file="SubtitleFormatExtensions.cs" company="PlaceholderCompany">
|
|
// Copyright (c) PlaceholderCompany. All rights reserved.
|
|
// </copyright>
|
|
|
|
namespace MediaBrowser.MediaEncoding.Subtitles;
|
|
|
|
using System.Diagnostics.CodeAnalysis;
|
|
using Nikse.SubtitleEdit.Core.SubtitleFormats;
|
|
|
|
internal static class SubtitleFormatExtensions
|
|
{
|
|
/// <summary>
|
|
/// Will try to find errors if supported by provider.
|
|
/// </summary>
|
|
/// <param name="format">The subtitle format.</param>
|
|
/// <param name="errors">The out errors value.</param>
|
|
/// <returns>True if errors are available for given format.</returns>
|
|
public static bool TryGetErrors(this SubtitleFormat format, [NotNullWhen(true)] out string? errors)
|
|
{
|
|
errors = format switch
|
|
{
|
|
SubStationAlpha ssa => ssa.Errors,
|
|
AdvancedSubStationAlpha assa => assa.Errors,
|
|
SubRip subRip => subRip.Errors,
|
|
MicroDvd microDvd => microDvd.Errors,
|
|
DCinemaSmpte2007 smpte2007 => smpte2007.Errors,
|
|
DCinemaSmpte2010 smpte2010 => smpte2010.Errors,
|
|
_ => null,
|
|
};
|
|
|
|
return !string.IsNullOrWhiteSpace(errors);
|
|
}
|
|
}
|