Remove more and more warnings

This commit is contained in:
Cody Robibero
2021-08-28 16:32:50 -06:00
parent e88367fe70
commit cba07b1ca6
89 changed files with 1554 additions and 681 deletions

View File

@@ -1,4 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable CS1591, CA1707
namespace MediaBrowser.Model.Dlna
{

View File

@@ -21,11 +21,7 @@ namespace MediaBrowser.Model.Dlna
public static ResolutionOptions Normalize(
int? inputBitrate,
int? unused1,
int? unused2,
int outputBitrate,
string inputCodec,
string outputCodec,
int? maxWidth,
int? maxHeight)
{

View File

@@ -694,7 +694,7 @@ namespace MediaBrowser.Model.Dlna
if (isEligibleForDirectPlay || isEligibleForDirectStream)
{
// See if it can be direct played
var directPlayInfo = GetVideoDirectPlayProfile(options, item, videoStream, audioStream, isEligibleForDirectPlay, isEligibleForDirectStream);
var directPlayInfo = GetVideoDirectPlayProfile(options, item, videoStream, audioStream, isEligibleForDirectStream);
var directPlay = directPlayInfo.Item1;
if (directPlay != null)
@@ -810,7 +810,7 @@ namespace MediaBrowser.Model.Dlna
// Honor requested max channels
playlistItem.GlobalMaxAudioChannels = options.MaxAudioChannels;
int audioBitrate = GetAudioBitrate(playlistItem.SubProtocol, options.GetMaxBitrate(false) ?? 0, playlistItem.TargetAudioCodec, audioStream, playlistItem);
int audioBitrate = GetAudioBitrate(options.GetMaxBitrate(false) ?? 0, playlistItem.TargetAudioCodec, audioStream, playlistItem);
playlistItem.AudioBitrate = Math.Min(playlistItem.AudioBitrate ?? audioBitrate, audioBitrate);
isFirstAppliedCodecProfile = true;
@@ -907,7 +907,7 @@ namespace MediaBrowser.Model.Dlna
return 192000;
}
private static int GetAudioBitrate(string subProtocol, long maxTotalBitrate, string[] targetAudioCodecs, MediaStream audioStream, StreamInfo item)
private static int GetAudioBitrate(long maxTotalBitrate, string[] targetAudioCodecs, MediaStream audioStream, StreamInfo item)
{
string targetAudioCodec = targetAudioCodecs.Length == 0 ? null : targetAudioCodecs[0];
@@ -1005,7 +1005,6 @@ namespace MediaBrowser.Model.Dlna
MediaSourceInfo mediaSource,
MediaStream videoStream,
MediaStream audioStream,
bool isEligibleForDirectPlay,
bool isEligibleForDirectStream)
{
if (options.ForceDirectPlay)
@@ -1146,7 +1145,7 @@ namespace MediaBrowser.Model.Dlna
{
string audioCodec = audioStream.Codec;
conditions = new List<ProfileCondition>();
bool? isSecondaryAudio = audioStream == null ? null : mediaSource.IsSecondaryAudio(audioStream);
bool? isSecondaryAudio = mediaSource.IsSecondaryAudio(audioStream);
foreach (var i in profile.CodecProfiles)
{
@@ -1262,7 +1261,7 @@ namespace MediaBrowser.Model.Dlna
continue;
}
if (playMethod == PlayMethod.Transcode && !IsSubtitleEmbedSupported(subtitleStream, profile, transcodingSubProtocol, outputContainer))
if (playMethod == PlayMethod.Transcode && !IsSubtitleEmbedSupported(outputContainer))
{
continue;
}
@@ -1291,7 +1290,7 @@ namespace MediaBrowser.Model.Dlna
continue;
}
if (playMethod == PlayMethod.Transcode && !IsSubtitleEmbedSupported(subtitleStream, profile, transcodingSubProtocol, outputContainer))
if (playMethod == PlayMethod.Transcode && !IsSubtitleEmbedSupported(outputContainer))
{
continue;
}
@@ -1313,7 +1312,7 @@ namespace MediaBrowser.Model.Dlna
};
}
private static bool IsSubtitleEmbedSupported(MediaStream subtitleStream, SubtitleProfile subtitleProfile, string transcodingSubProtocol, string transcodingContainer)
private static bool IsSubtitleEmbedSupported(string transcodingContainer)
{
if (!string.IsNullOrEmpty(transcodingContainer))
{
@@ -1728,18 +1727,14 @@ namespace MediaBrowser.Model.Dlna
continue;
}
if (!string.IsNullOrEmpty(value))
// change from split by | to comma
// strip spaces to avoid having to encode
var values = value
.Split('|', StringSplitOptions.RemoveEmptyEntries);
if (condition.Condition == ProfileConditionType.Equals || condition.Condition == ProfileConditionType.EqualsAny)
{
// change from split by | to comma
// strip spaces to avoid having to encode
var values = value
.Split('|', StringSplitOptions.RemoveEmptyEntries);
if (condition.Condition == ProfileConditionType.Equals || condition.Condition == ProfileConditionType.EqualsAny)
{
item.SetOption(qualifier, "profile", string.Join(',', values));
}
item.SetOption(qualifier, "profile", string.Join(',', values));
}
break;

View File

@@ -636,7 +636,7 @@ namespace MediaBrowser.Model.Dlna
continue;
}
var encodedValue = pair.Value.Replace(" ", "%20");
var encodedValue = pair.Value.Replace(" ", "%20", StringComparison.Ordinal);
list.Add(string.Format(CultureInfo.InvariantCulture, "{0}={1}", pair.Name, encodedValue));
}

View File

@@ -261,7 +261,7 @@ namespace MediaBrowser.Model.Entities
foreach (var tag in attributes)
{
// Keep Tags that are not already in Title.
if (Title.IndexOf(tag, StringComparison.OrdinalIgnoreCase) == -1)
if (!Title.Contains(tag, StringComparison.OrdinalIgnoreCase))
{
result.Append(" - ").Append(tag);
}

View File

@@ -51,7 +51,7 @@ namespace MediaBrowser.Model.IO
/// <returns>A <see cref="FileSystemMetadata" /> object.</returns>
/// <remarks><para>If the specified path points to a directory, the returned <see cref="FileSystemMetadata" /> object's
/// <see cref="FileSystemMetadata.IsDirectory" /> property and the <see cref="FileSystemMetadata.Exists" /> property will both be set to false.</para>
/// <para>For automatic handling of files <b>and</b> directories, use <see cref="M:IFileSystem.GetFileSystemInfo(System.String)" />.</para></remarks>
/// <para>For automatic handling of files <b>and</b> directories, use <see cref="GetFileSystemInfo(string)" />.</para></remarks>
FileSystemMetadata GetFileInfo(string path);
/// <summary>
@@ -61,7 +61,7 @@ namespace MediaBrowser.Model.IO
/// <returns>A <see cref="FileSystemMetadata" /> object.</returns>
/// <remarks><para>If the specified path points to a file, the returned <see cref="FileSystemMetadata" /> object's
/// <see cref="FileSystemMetadata.IsDirectory" /> property will be set to true and the <see cref="FileSystemMetadata.Exists" /> property will be set to false.</para>
/// <para>For automatic handling of files <b>and</b> directories, use <see cref="M:IFileSystem.GetFileSystemInfo(System.String)" />.</para></remarks>
/// <para>For automatic handling of files <b>and</b> directories, use <see cref="GetFileSystemInfo(string)" />.</para></remarks>
FileSystemMetadata GetDirectoryInfo(string path);
/// <summary>