1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-26 17:47:08 +00:00

Added some additional logging around sizing.

This commit is contained in:
Mark McDowall 2012-04-16 20:42:18 -07:00
parent 733ebe3cfa
commit 5650f891ee
2 changed files with 11 additions and 1 deletions

View file

@ -25,6 +25,7 @@ public AcceptableSizeSpecification()
public virtual bool IsSatisfiedBy(EpisodeParseResult subject)
{
logger.Trace("Beginning size check for: {0}", subject);
var qualityType = _qualityTypeProvider.Get((int)subject.Quality.QualityType);
//Need to determine if this is a 30 or 60 minute episode
@ -33,7 +34,10 @@ public virtual bool IsSatisfiedBy(EpisodeParseResult subject)
//0 will be treated as unlimited
if (qualityType.MaxSize == 0)
{
logger.Trace("Max size is 0 (unlimited) - skipping check.");
return true;
}
var maxSize = qualityType.MaxSize.Megabytes();
var series = subject.Series;
@ -57,8 +61,12 @@ public virtual bool IsSatisfiedBy(EpisodeParseResult subject)
//If the parsed size is greater than maxSize we don't want it
if (subject.Size > maxSize)
{
logger.Trace("Item: {0}, Size: {1} is greater than maximum allowed size ({1}), rejecting.", subject, subject.Size, maxSize);
return false;
}
logger.Trace("Item: {0}, meets size contraints.", subject);
return true;
}

View file

@ -239,6 +239,8 @@ public EpisodeParseResult ParseFeed(SyndicationItem item)
var episodeParseResult = Parser.ParseTitle(title);
if (episodeParseResult != null) episodeParseResult.Age = DateTime.Now.Date.Subtract(item.PublishDate.Date).Days;
_logger.Trace("Parsed: {0} from: {1}", episodeParseResult, item.Title.Text);
return CustomParser(item, episodeParseResult);
}