mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-26 22:46:37 -04:00
Replaced built-in valuetypes with language keywords.
This commit is contained in:
@@ -263,15 +263,15 @@ namespace NzbDrone.Core.Parser
|
||||
var titleWithoutExtension = RemoveFileExtension(title).ToCharArray();
|
||||
Array.Reverse(titleWithoutExtension);
|
||||
|
||||
title = new String(titleWithoutExtension) + title.Substring(titleWithoutExtension.Length);
|
||||
title = new string(titleWithoutExtension) + title.Substring(titleWithoutExtension.Length);
|
||||
|
||||
Logger.Debug("Reversed name detected. Converted to '{0}'", title);
|
||||
}
|
||||
|
||||
var simpleTitle = SimpleTitleRegex.Replace(title, String.Empty);
|
||||
var simpleTitle = SimpleTitleRegex.Replace(title, string.Empty);
|
||||
|
||||
// TODO: Quick fix stripping [url] - prefixes.
|
||||
simpleTitle = WebsitePrefixRegex.Replace(simpleTitle, String.Empty);
|
||||
simpleTitle = WebsitePrefixRegex.Replace(simpleTitle, string.Empty);
|
||||
|
||||
var airDateMatch = AirDateRegex.Match(simpleTitle);
|
||||
if (airDateMatch.Success)
|
||||
@@ -282,7 +282,7 @@ namespace NzbDrone.Core.Parser
|
||||
var sixDigitAirDateMatch = SixDigitAirDateRegex.Match(simpleTitle);
|
||||
if (sixDigitAirDateMatch.Success)
|
||||
{
|
||||
var fixedDate = String.Format("20{0}.{1}.{2}", sixDigitAirDateMatch.Groups["airyear"].Value,
|
||||
var fixedDate = string.Format("20{0}.{1}.{2}", sixDigitAirDateMatch.Groups["airyear"].Value,
|
||||
sixDigitAirDateMatch.Groups["airmonth"].Value,
|
||||
sixDigitAirDateMatch.Groups["airday"].Value);
|
||||
|
||||
@@ -370,15 +370,15 @@ namespace NzbDrone.Core.Parser
|
||||
long number = 0;
|
||||
|
||||
//If Title only contains numbers return it as is.
|
||||
if (Int64.TryParse(title, out number))
|
||||
if (long.TryParse(title, out number))
|
||||
return title;
|
||||
|
||||
return NormalizeRegex.Replace(title, String.Empty).ToLower().RemoveAccent();
|
||||
return NormalizeRegex.Replace(title, string.Empty).ToLower().RemoveAccent();
|
||||
}
|
||||
|
||||
public static string NormalizeEpisodeTitle(string title)
|
||||
{
|
||||
title = SpecialEpisodeWordRegex.Replace(title, String.Empty);
|
||||
title = SpecialEpisodeWordRegex.Replace(title, string.Empty);
|
||||
title = PunctuationRegex.Replace(title, " ");
|
||||
title = DuplicateSpacesRegex.Replace(title, " ");
|
||||
|
||||
@@ -389,8 +389,8 @@ namespace NzbDrone.Core.Parser
|
||||
public static string NormalizeTitle(string title)
|
||||
{
|
||||
title = WordDelimiterRegex.Replace(title, " ");
|
||||
title = PunctuationRegex.Replace(title, String.Empty);
|
||||
title = CommonWordRegex.Replace(title, String.Empty);
|
||||
title = PunctuationRegex.Replace(title, string.Empty);
|
||||
title = CommonWordRegex.Replace(title, string.Empty);
|
||||
title = DuplicateSpacesRegex.Replace(title, " ");
|
||||
|
||||
return title.Trim().ToLower();
|
||||
@@ -418,7 +418,7 @@ namespace NzbDrone.Core.Parser
|
||||
var group = matches.OfType<Match>().Last().Groups["releasegroup"].Value;
|
||||
int groupIsNumeric;
|
||||
|
||||
if (Int32.TryParse(group, out groupIsNumeric))
|
||||
if (int.TryParse(group, out groupIsNumeric))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -436,7 +436,7 @@ namespace NzbDrone.Core.Parser
|
||||
var extension = m.Value.ToLower();
|
||||
if (MediaFiles.MediaFileExtensions.Extensions.Contains(extension) || new[] { ".par2", ".nzb" }.Contains(extension))
|
||||
{
|
||||
return String.Empty;
|
||||
return string.Empty;
|
||||
}
|
||||
return m.Value;
|
||||
});
|
||||
@@ -561,7 +561,7 @@ namespace NzbDrone.Core.Parser
|
||||
seriesName = RequestInfoRegex.Replace(seriesName, "").Trim(' ');
|
||||
|
||||
int airYear;
|
||||
Int32.TryParse(matchCollection[0].Groups["airyear"].Value, out airYear);
|
||||
int.TryParse(matchCollection[0].Groups["airyear"].Value, out airYear);
|
||||
|
||||
ParsedEpisodeInfo result;
|
||||
|
||||
@@ -572,7 +572,7 @@ namespace NzbDrone.Core.Parser
|
||||
foreach (Capture seasonCapture in matchCollection[0].Groups["season"].Captures)
|
||||
{
|
||||
int parsedSeason;
|
||||
if (Int32.TryParse(seasonCapture.Value, out parsedSeason))
|
||||
if (int.TryParse(seasonCapture.Value, out parsedSeason))
|
||||
seasons.Add(parsedSeason);
|
||||
}
|
||||
|
||||
@@ -697,7 +697,7 @@ namespace NzbDrone.Core.Parser
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!title.Any(Char.IsLetterOrDigit))
|
||||
if (!title.Any(char.IsLetterOrDigit))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -722,7 +722,7 @@ namespace NzbDrone.Core.Parser
|
||||
return subGroup.Value;
|
||||
}
|
||||
|
||||
return String.Empty;
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
private static string GetReleaseHash(MatchCollection matchCollection)
|
||||
@@ -735,13 +735,13 @@ namespace NzbDrone.Core.Parser
|
||||
|
||||
if (hashValue.Equals("1280x720"))
|
||||
{
|
||||
return String.Empty;
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
return hashValue;
|
||||
}
|
||||
|
||||
return String.Empty;
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user