Fixed: (AnimeBytes) Parsing season improvements

This commit is contained in:
Bogdan 2023-04-25 15:11:45 +03:00
parent 25ba9195cf
commit fc6a31ea78

View file

@ -368,7 +368,7 @@ public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
if (_settings.EnableSonarrCompatibility)
{
var simpleSeasonRegex = new Regex(@"Season (\d+)", RegexOptions.Compiled);
var simpleSeasonRegex = new Regex(@"\bSeason (\d+)\b", RegexOptions.Compiled);
var simpleSeasonRegexMatch = simpleSeasonRegex.Match(releaseInfo);
if (simpleSeasonRegexMatch.Success)
{
@ -376,7 +376,7 @@ public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
}
}
var episodeRegex = new Regex(@"Episode (\d+)", RegexOptions.Compiled);
var episodeRegex = new Regex(@"\bEpisode (\d+)\b", RegexOptions.Compiled);
var episodeRegexMatch = episodeRegex.Match(releaseInfo);
if (episodeRegexMatch.Success)
{
@ -579,7 +579,7 @@ public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
{
var advancedSeasonRegex = new Regex(@"(\d+)(st|nd|rd|th) Season", RegexOptions.Compiled | RegexOptions.IgnoreCase);
var seasonCharactersRegex = new Regex(@"(I{2,})$", RegexOptions.Compiled);
var seasonNumberRegex = new Regex(@"\b([2-9])$", RegexOptions.Compiled);
var seasonNumberRegex = new Regex(@"\b(?:S)?([2-9])$", RegexOptions.Compiled);
foreach (var title in titles)
{