|
|
|
@ -254,6 +254,11 @@ namespace NzbDrone.Core.Parser
|
|
|
|
|
new Regex(@"^(?<title>.+?)[-_. ]S(?<season>(?<!\d+)(?:\d{1,2}|\d{4})(?!\d+))(?:[-_. ]?[ex]?(?<episode>(?<!\d+)\d{1,2}(?!\d+)))+",
|
|
|
|
|
RegexOptions.IgnoreCase | RegexOptions.Compiled),
|
|
|
|
|
|
|
|
|
|
// TODO: Before this
|
|
|
|
|
// Single or multi episode releases with multiple titles, each followed by season and episode numbers in brackets
|
|
|
|
|
new Regex(@"^(?<title>.*?)[ ._]\(S(?<season>(?<!\d+)\d{1,2}(?!\d+))(?:\W|_)?E?[ ._]?(?<episode>(?<!\d+)\d{1,2}(?!\d+))(?:-(?<episode>(?<!\d+)\d{1,2}(?!\d+)))?\)(?:[ ._]\/[ ._])(?<title>.*?)[ ._]\(",
|
|
|
|
|
RegexOptions.IgnoreCase | RegexOptions.Compiled),
|
|
|
|
|
|
|
|
|
|
// Single episode season or episode S1E1 or S1-E1 or S1.Ep1 or S01.Ep.01
|
|
|
|
|
new Regex(@"(?:.*(?:\""|^))(?<title>.*?)(?:\W?|_)S(?<season>(?<!\d+)\d{1,2}(?!\d+))(?:\W|_)?Ep?[ ._]?(?<episode>(?<!\d+)\d{1,2}(?!\d+))",
|
|
|
|
|
RegexOptions.IgnoreCase | RegexOptions.Compiled),
|
|
|
|
@ -883,7 +888,7 @@ namespace NzbDrone.Core.Parser
|
|
|
|
|
return title;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static SeriesTitleInfo GetSeriesTitleInfo(string title)
|
|
|
|
|
private static SeriesTitleInfo GetSeriesTitleInfo(string title, MatchCollection matchCollection)
|
|
|
|
|
{
|
|
|
|
|
var seriesTitleInfo = new SeriesTitleInfo();
|
|
|
|
|
seriesTitleInfo.Title = title;
|
|
|
|
@ -906,6 +911,10 @@ namespace NzbDrone.Core.Parser
|
|
|
|
|
{
|
|
|
|
|
seriesTitleInfo.AllTitles = matchComponents.Groups["title"].Captures.OfType<Capture>().Select(v => v.Value).ToArray();
|
|
|
|
|
}
|
|
|
|
|
else if (matchCollection[0].Groups["title"].Captures.Count > 1)
|
|
|
|
|
{
|
|
|
|
|
seriesTitleInfo.AllTitles = matchCollection[0].Groups["title"].Captures.Select(c => c.Value.Replace('.', ' ').Replace('_', ' ')).ToArray();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return seriesTitleInfo;
|
|
|
|
|
}
|
|
|
|
@ -1112,7 +1121,7 @@ namespace NzbDrone.Core.Parser
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result.SeriesTitle = seriesName;
|
|
|
|
|
result.SeriesTitleInfo = GetSeriesTitleInfo(result.SeriesTitle);
|
|
|
|
|
result.SeriesTitleInfo = GetSeriesTitleInfo(result.SeriesTitle, matchCollection);
|
|
|
|
|
|
|
|
|
|
Logger.Debug("Episode Parsed. {0}", result);
|
|
|
|
|
|
|
|
|
|