Make MediaBrowser.MediaEncoding warnings free

This commit is contained in:
Bond_009
2020-08-20 12:16:24 +02:00
parent 250e351613
commit ab2147751f
22 changed files with 236 additions and 213 deletions

View File

@@ -42,7 +42,8 @@ namespace MediaBrowser.MediaEncoding.Probing
var info = new MediaInfo
{
Path = path,
Protocol = protocol
Protocol = protocol,
VideoType = videoType
};
FFProbeHelpers.NormalizeFFProbeResult(data);
@@ -1133,7 +1134,7 @@ namespace MediaBrowser.MediaEncoding.Probing
{
// Only use the comma as a delimeter if there are no slashes or pipes.
// We want to be careful not to split names that have commas in them
var delimeter = !allowCommaDelimiter || _nameDelimiters.Any(i => val.IndexOf(i) != -1) ?
var delimeter = !allowCommaDelimiter || _nameDelimiters.Any(i => val.IndexOf(i, StringComparison.Ordinal) != -1) ?
_nameDelimiters :
new[] { ',' };
@@ -1377,8 +1378,8 @@ namespace MediaBrowser.MediaEncoding.Probing
if (subtitle.Contains('/', StringComparison.Ordinal)) // It contains a episode number and season number
{
string[] numbers = subtitle.Split(' ');
video.IndexNumber = int.Parse(numbers[0].Replace(".", string.Empty, StringComparison.Ordinal).Split('/')[0]);
int totalEpisodesInSeason = int.Parse(numbers[0].Replace(".", string.Empty, StringComparison.Ordinal).Split('/')[1]);
video.IndexNumber = int.Parse(numbers[0].Replace(".", string.Empty, StringComparison.Ordinal).Split('/')[0], CultureInfo.InvariantCulture);
int totalEpisodesInSeason = int.Parse(numbers[0].Replace(".", string.Empty, StringComparison.Ordinal).Split('/')[1], CultureInfo.InvariantCulture);
description = string.Join(" ", numbers, 1, numbers.Length - 1).Trim(); // Skip the first, concatenate the rest, clean up spaces and save it
}