diff --git a/NzbDrone.Core.Test/DecisionEngineTests/AcceptableSizeSpecificationFixture.cs b/NzbDrone.Core.Test/DecisionEngineTests/AcceptableSizeSpecificationFixture.cs index 9b890506b..a7d064f47 100644 --- a/NzbDrone.Core.Test/DecisionEngineTests/AcceptableSizeSpecificationFixture.cs +++ b/NzbDrone.Core.Test/DecisionEngineTests/AcceptableSizeSpecificationFixture.cs @@ -379,5 +379,20 @@ public void should_return_true_if_RAWHD() Subject.IsSatisfiedBy(parseResult).Should().BeTrue(); } + + + [Test] + public void should_always_return_false_if_unknow() + { + var parseResult = new RemoteEpisode + { + ParsedEpisodeInfo = new ParsedEpisodeInfo { Quality = new QualityModel(Quality.Unknown, false) }, + }; + + Subject.IsSatisfiedBy(parseResult).Should().BeFalse(); + + + Mocker.GetMock().Verify(c=>c.Get(It.IsAny()),Times.Never()); + } } } \ No newline at end of file diff --git a/NzbDrone.Core/DecisionEngine/Specifications/AcceptableSizeSpecification.cs b/NzbDrone.Core/DecisionEngine/Specifications/AcceptableSizeSpecification.cs index 7184e9efc..436040a17 100644 --- a/NzbDrone.Core/DecisionEngine/Specifications/AcceptableSizeSpecification.cs +++ b/NzbDrone.Core/DecisionEngine/Specifications/AcceptableSizeSpecification.cs @@ -26,15 +26,24 @@ public string RejectionReason public virtual bool IsSatisfiedBy(RemoteEpisode subject) { + _logger.Trace("Beginning size check for: {0}", subject); - if (subject.ParsedEpisodeInfo.Quality.Quality == Quality.RAWHD) + var quality = subject.ParsedEpisodeInfo.Quality.Quality; + + if (quality == Quality.RAWHD) { _logger.Trace("Raw-HD release found, skipping size check."); return true; } - var qualityType = _qualityTypeProvider.Get((int)subject.ParsedEpisodeInfo.Quality.Quality); + if (quality == Quality.Unknown) + { + _logger.Trace("Unknown quality. skipping size check."); + return false; + } + + var qualityType = _qualityTypeProvider.Get(quality.Id); if (qualityType.MaxSize == 0) { @@ -43,12 +52,9 @@ public virtual bool IsSatisfiedBy(RemoteEpisode subject) } var maxSize = qualityType.MaxSize.Megabytes(); - var series = subject.Series; //Multiply maxSize by Series.Runtime - maxSize = maxSize * series.Runtime; - - maxSize = maxSize * subject.Episodes.Count; + maxSize = maxSize * subject.Series.Runtime * subject.Episodes.Count; //Check if there was only one episode parsed //and it is the first or last episode of the season diff --git a/UI/Content/Images/poster-dark.jpg b/UI/Content/Images/poster-dark.jpg new file mode 100644 index 000000000..dfe5b7302 Binary files /dev/null and b/UI/Content/Images/poster-dark.jpg differ diff --git a/UI/MainMenuView.js b/UI/MainMenuView.js index 28748dd86..c37882dfb 100644 --- a/UI/MainMenuView.js +++ b/UI/MainMenuView.js @@ -1,6 +1,6 @@ "use strict"; define(['app'], function () { - NzbDrone.MainMenuView = Backbone.Marionette.ItemView.extend({ + var MainMenuView = Backbone.Marionette.ItemView.extend({ events: { 'click a': 'onClick' }, @@ -37,6 +37,6 @@ define(['app'], function () { } }); + return new MainMenuView(); - return new NzbDrone.MainMenuView(); });