mirror of
https://github.com/Sonarr/Sonarr
synced 2025-12-06 08:28:37 +01:00
parent
a4a18d6121
commit
994faa60c6
2 changed files with 23 additions and 0 deletions
|
|
@ -167,6 +167,19 @@ public void should_parse_absolute_specials(string postTitle, string title, int a
|
||||||
result.Special.Should().BeTrue();
|
result.Special.Should().BeTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[TestCase("[Underwater] Another OVA - The Other -Karma- (BD 1080p) [3A561D0E].mkv", "Another", 0)]
|
||||||
|
public void should_parse_absolute_specials_without_absolute_number(string postTitle, string title, int absoluteEpisodeNumber)
|
||||||
|
{
|
||||||
|
var result = Parser.Parser.ParseTitle(postTitle);
|
||||||
|
result.Should().NotBeNull();
|
||||||
|
result.AbsoluteEpisodeNumbers.Should().BeEmpty();
|
||||||
|
result.SeasonNumber.Should().Be(0);
|
||||||
|
result.EpisodeNumbers.Should().BeEmpty();
|
||||||
|
result.SeriesTitle.Should().Be(title);
|
||||||
|
result.FullSeason.Should().BeFalse();
|
||||||
|
result.Special.Should().BeTrue();
|
||||||
|
}
|
||||||
|
|
||||||
[TestCase("[ANBU-AonE]_SeriesTitle_26-27_[F224EF26].avi", "SeriesTitle", 26, 27)]
|
[TestCase("[ANBU-AonE]_SeriesTitle_26-27_[F224EF26].avi", "SeriesTitle", 26, 27)]
|
||||||
[TestCase("[Doutei] Some Good, Anime Show - 01-12 [BD][720p-AAC]", "Some Good, Anime Show", 1, 12)]
|
[TestCase("[Doutei] Some Good, Anime Show - 01-12 [BD][720p-AAC]", "Some Good, Anime Show", 1, 12)]
|
||||||
[TestCase("Series Title (2010) - 01-02-03 - Episode Title (1) HDTV-720p", "Series Title (2010)", 1, 3)]
|
[TestCase("Series Title (2010) - 01-02-03 - Episode Title (1) HDTV-720p", "Series Title (2010)", 1, 3)]
|
||||||
|
|
|
||||||
|
|
@ -440,6 +440,10 @@ public static class Parser
|
||||||
|
|
||||||
// Episodes without a title, Single episode numbers (S1E1, 1x1)
|
// Episodes without a title, Single episode numbers (S1E1, 1x1)
|
||||||
new Regex(@"^(?:S?(?<season>(?<!\d+)(?:\d{1,2}|\d{4})(?!\d+))(?:(?:[-_ ]?[ex])(?<episode>\d{1}(?!\d+))))",
|
new Regex(@"^(?:S?(?<season>(?<!\d+)(?:\d{1,2}|\d{4})(?!\d+))(?:(?:[-_ ]?[ex])(?<episode>\d{1}(?!\d+))))",
|
||||||
|
RegexOptions.IgnoreCase | RegexOptions.Compiled),
|
||||||
|
|
||||||
|
// Anime OVA special
|
||||||
|
new Regex(@"^\[(?<subgroup>.+?)\][-_. ]?(?<title>.+?)(?:[-_. ]+(?<special>special|ova|ovd)).*?(?<hash>[(\[]\w{8}[)\]])?(?:$|\.mkv)",
|
||||||
RegexOptions.IgnoreCase | RegexOptions.Compiled)
|
RegexOptions.IgnoreCase | RegexOptions.Compiled)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -614,6 +618,8 @@ public static ParsedEpisodeInfo ParsePath(string path)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Skip for anime specials
|
||||||
|
|
||||||
if (result == null)
|
if (result == null)
|
||||||
{
|
{
|
||||||
Logger.Debug("Attempting to parse episode info using combined directory and file names. {0}", fileInfo.Directory.Name);
|
Logger.Debug("Attempting to parse episode info using combined directory and file names. {0}", fileInfo.Directory.Name);
|
||||||
|
|
@ -1015,6 +1021,10 @@ private static ParsedEpisodeInfo ParseMatchCollection(MatchCollection matchColle
|
||||||
result.SeasonPart = Convert.ToInt32(seasonPart);
|
result.SeasonPart = Convert.ToInt32(seasonPart);
|
||||||
result.IsPartialSeason = true;
|
result.IsPartialSeason = true;
|
||||||
}
|
}
|
||||||
|
else if (matchCollection[0].Groups["special"].Success)
|
||||||
|
{
|
||||||
|
result.Special = true;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
result.FullSeason = true;
|
result.FullSeason = true;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue