Small tweaks based on feedback from @markus101

pull/4/head
Cyberlane 11 years ago committed by Mark McDowall
parent 44c1bc632e
commit 26d3d9dcd6

@ -44,7 +44,7 @@ namespace NzbDrone.Core.Parser.Model
public bool IsAbsoluteNumbering() public bool IsAbsoluteNumbering()
{ {
return AbsoluteEpisodeNumbers.Length > 0; return AbsoluteEpisodeNumbers.Any();
} }
} }
} }

@ -255,11 +255,7 @@ namespace NzbDrone.Core.Parser
var absoluteEpisodeCaptures = matchGroup.Groups["absoluteepisode"].Captures.Cast<Capture>().ToList(); var absoluteEpisodeCaptures = matchGroup.Groups["absoluteepisode"].Captures.Cast<Capture>().ToList();
//Allows use to return a list of 0 episodes (We can handle that as a full season release) //Allows use to return a list of 0 episodes (We can handle that as a full season release)
var eps = episodeCaptures.Any(); if (episodeCaptures.Any())
var epsAbs = absoluteEpisodeCaptures.Any();
if (eps || epsAbs)
{
if (eps)
{ {
var first = Convert.ToInt32(episodeCaptures.First().Value); var first = Convert.ToInt32(episodeCaptures.First().Value);
var last = Convert.ToInt32(episodeCaptures.Last().Value); var last = Convert.ToInt32(episodeCaptures.Last().Value);
@ -272,7 +268,7 @@ namespace NzbDrone.Core.Parser
var count = last - first + 1; var count = last - first + 1;
result.EpisodeNumbers = Enumerable.Range(first, count).ToArray(); result.EpisodeNumbers = Enumerable.Range(first, count).ToArray();
} }
if (epsAbs) else if (absoluteEpisodeCaptures.Any())
{ {
var first = Convert.ToInt32(absoluteEpisodeCaptures.First().Value); var first = Convert.ToInt32(absoluteEpisodeCaptures.First().Value);
var last = Convert.ToInt32(absoluteEpisodeCaptures.Last().Value); var last = Convert.ToInt32(absoluteEpisodeCaptures.Last().Value);
@ -285,7 +281,6 @@ namespace NzbDrone.Core.Parser
var count = last - first + 1; var count = last - first + 1;
result.AbsoluteEpisodeNumbers = Enumerable.Range(first, count).ToArray(); result.AbsoluteEpisodeNumbers = Enumerable.Range(first, count).ToArray();
} }
}
else else
{ {
//Check to see if this is an "Extras" or "SUBPACK" release, if it is, return NULL //Check to see if this is an "Extras" or "SUBPACK" release, if it is, return NULL

@ -137,11 +137,9 @@ namespace NzbDrone.Core.Parser
if (episodeInfo != null) if (episodeInfo != null)
{ {
_logger.Info("Using absolute episode number {0} for: {1} - Scene: {2}x{3:00} - TVDB: {4}x{5:00}", _logger.Info("Using absolute episode number {0} for: {1} - TVDB: {2}x{3:00}",
absoluteEpisodeNumber, absoluteEpisodeNumber,
series.Title, series.Title,
episodeInfo.SceneSeasonNumber,
episodeInfo.SceneEpisodeNumber,
episodeInfo.SeasonNumber, episodeInfo.SeasonNumber,
episodeInfo.EpisodeNumber); episodeInfo.EpisodeNumber);
result.Add(episodeInfo); result.Add(episodeInfo);

Loading…
Cancel
Save