mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
unknow quality is rejected by AcceptableSizeSpecification
This commit is contained in:
@@ -379,5 +379,20 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
|||||||
|
|
||||||
Subject.IsSatisfiedBy(parseResult).Should().BeTrue();
|
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<IQualitySizeService>().Verify(c=>c.Get(It.IsAny<int>()),Times.Never());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -26,15 +26,24 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
|
|||||||
|
|
||||||
public virtual bool IsSatisfiedBy(RemoteEpisode subject)
|
public virtual bool IsSatisfiedBy(RemoteEpisode subject)
|
||||||
{
|
{
|
||||||
|
|
||||||
_logger.Trace("Beginning size check for: {0}", 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.");
|
_logger.Trace("Raw-HD release found, skipping size check.");
|
||||||
return true;
|
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)
|
if (qualityType.MaxSize == 0)
|
||||||
{
|
{
|
||||||
@@ -43,12 +52,9 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
|
|||||||
}
|
}
|
||||||
|
|
||||||
var maxSize = qualityType.MaxSize.Megabytes();
|
var maxSize = qualityType.MaxSize.Megabytes();
|
||||||
var series = subject.Series;
|
|
||||||
|
|
||||||
//Multiply maxSize by Series.Runtime
|
//Multiply maxSize by Series.Runtime
|
||||||
maxSize = maxSize * series.Runtime;
|
maxSize = maxSize * subject.Series.Runtime * subject.Episodes.Count;
|
||||||
|
|
||||||
maxSize = maxSize * subject.Episodes.Count;
|
|
||||||
|
|
||||||
//Check if there was only one episode parsed
|
//Check if there was only one episode parsed
|
||||||
//and it is the first or last episode of the season
|
//and it is the first or last episode of the season
|
||||||
|
BIN
UI/Content/Images/poster-dark.jpg
Normal file
BIN
UI/Content/Images/poster-dark.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
@@ -1,6 +1,6 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
define(['app'], function () {
|
define(['app'], function () {
|
||||||
NzbDrone.MainMenuView = Backbone.Marionette.ItemView.extend({
|
var MainMenuView = Backbone.Marionette.ItemView.extend({
|
||||||
events: {
|
events: {
|
||||||
'click a': 'onClick'
|
'click a': 'onClick'
|
||||||
},
|
},
|
||||||
@@ -37,6 +37,6 @@ define(['app'], function () {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return new MainMenuView();
|
||||||
|
|
||||||
return new NzbDrone.MainMenuView();
|
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user