mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-04 10:02:40 +01:00
parent
87d00abdf1
commit
2ab9bb4fce
@ -122,6 +122,7 @@ public class SingleEpisodeParserFixture : CoreTest
|
||||
[TestCase("Judge Judy 2016 02 25 S20E143", "Judge Judy", 20, 143)]
|
||||
[TestCase("Red Dwarf - S02 - E06 - Parallel Universe", "Red Dwarf", 2, 6)]
|
||||
[TestCase("O.J.Simpson.Made.in.America.Part.Two.720p.HDTV.x264-2HD", "O J Simpson Made in America", 1, 2)]
|
||||
[TestCase("The.100000.Dollar.Pyramid.2016.S01E05.720p.HDTV.x264-W4F", "The 100000 Dollar Pyramid 2016", 1, 5)]
|
||||
//[TestCase("", "", 0, 0)]
|
||||
public void should_parse_single_episode(string postTitle, string title, int seasonNumber, int episodeNumber)
|
||||
{
|
||||
|
@ -319,11 +319,16 @@ public static ParsedEpisodeInfo ParseTitle(string title)
|
||||
var sixDigitAirDateMatch = SixDigitAirDateRegex.Match(simpleTitle);
|
||||
if (sixDigitAirDateMatch.Success)
|
||||
{
|
||||
var fixedDate = string.Format("20{0}.{1}.{2}", sixDigitAirDateMatch.Groups["airyear"].Value,
|
||||
sixDigitAirDateMatch.Groups["airmonth"].Value,
|
||||
sixDigitAirDateMatch.Groups["airday"].Value);
|
||||
var airYear = sixDigitAirDateMatch.Groups["airyear"].Value;
|
||||
var airMonth = sixDigitAirDateMatch.Groups["airmonth"].Value;
|
||||
var airDay = sixDigitAirDateMatch.Groups["airday"].Value;
|
||||
|
||||
simpleTitle = simpleTitle.Replace(sixDigitAirDateMatch.Groups["airdate"].Value, fixedDate);
|
||||
if (airMonth != "00" || airDay != "00")
|
||||
{
|
||||
var fixedDate = string.Format("20{0}.{1}.{2}", airYear, airMonth, airDay);
|
||||
|
||||
simpleTitle = simpleTitle.Replace(sixDigitAirDateMatch.Groups["airdate"].Value, fixedDate);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var regex in ReportTitleRegex)
|
||||
|
Loading…
Reference in New Issue
Block a user