From 1df5b5034b944360a82957acd22a3b1dae040113 Mon Sep 17 00:00:00 2001 From: Joe Rogers <1337joe@gmail.com> Date: Sat, 27 Nov 2021 20:35:18 +0100 Subject: [PATCH] Address suppressed warnings --- .../MediaInfo/SubtitleResolver.cs | 33 ++++++++++++++++--- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/MediaBrowser.Providers/MediaInfo/SubtitleResolver.cs b/MediaBrowser.Providers/MediaInfo/SubtitleResolver.cs index d0512ce575..ba284187ed 100644 --- a/MediaBrowser.Providers/MediaInfo/SubtitleResolver.cs +++ b/MediaBrowser.Providers/MediaInfo/SubtitleResolver.cs @@ -1,7 +1,3 @@ -#nullable disable - -#pragma warning disable CA1002, CS1591 - using System; using System.Collections.Generic; using System.IO; @@ -12,15 +8,30 @@ using MediaBrowser.Model.Globalization; namespace MediaBrowser.Providers.MediaInfo { + /// + /// Resolves external subtitles for videos. + /// public class SubtitleResolver { private readonly ILocalizationManager _localization; + /// + /// Initializes a new instance of the class. + /// + /// The localization manager. public SubtitleResolver(ILocalizationManager localization) { _localization = localization; } + /// + /// Retrieves the external subtitle streams for the provided video. + /// + /// The video to search from. + /// The stream index to start adding subtitle streams at. + /// The directory service to search for files. + /// True if the directory service cache should be cleared before searching. + /// The external subtitle streams located. public List GetExternalSubtitleStreams( Video video, int startIndex, @@ -56,6 +67,13 @@ namespace MediaBrowser.Providers.MediaInfo return streams; } + /// + /// Locates the external subtitle files for the provided video. + /// + /// The video to search from. + /// The directory service to search for files. + /// True if the directory service cache should be cleared before searching. + /// The external subtitle file paths located. public IEnumerable GetExternalSubtitleFiles( Video video, IDirectoryService directoryService, @@ -74,6 +92,13 @@ namespace MediaBrowser.Providers.MediaInfo } } + /// + /// Extracts the subtitle files from the provided list and adds them to the list of streams. + /// + /// The list of streams to add external subtitles to. + /// The path to the video file. + /// The stream index to start adding subtitle streams at. + /// The files to add if they are subtitles. public void AddExternalSubtitleStreams( List streams, string videoPath,