1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-20 21:54:58 -04:00

New: Allow user to choose whether delay profile should apply to release of the highest enabled quality

This commit is contained in:
Taloth Saldono
2021-03-06 02:38:14 +01:00
parent 24ca47356e
commit d668e923af
8 changed files with 95 additions and 8 deletions
@@ -67,14 +67,17 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.RssSync
}
// If quality meets or exceeds the best allowed quality in the profile accept it immediately
var bestQualityInProfile = qualityProfile.LastAllowedQuality();
var isBestInProfile = qualityComparer.Compare(subject.ParsedEpisodeInfo.Quality.Quality, bestQualityInProfile) >= 0;
var isBestInProfileLanguage = languageComparer.Compare(subject.ParsedEpisodeInfo.Language, languageProfile.LastAllowedLanguage()) >= 0;
if (isBestInProfile && isBestInProfileLanguage && isPreferredProtocol)
if (delayProfile.BypassIfHighestQuality)
{
_logger.Debug("Quality and language is highest in profile for preferred protocol, will not delay");
return Decision.Accept();
var bestQualityInProfile = qualityProfile.LastAllowedQuality();
var isBestInProfile = qualityComparer.Compare(subject.ParsedEpisodeInfo.Quality.Quality, bestQualityInProfile) >= 0;
var isBestInProfileLanguage = languageComparer.Compare(subject.ParsedEpisodeInfo.Language, languageProfile.LastAllowedLanguage()) >= 0;
if (isBestInProfile && isBestInProfileLanguage && isPreferredProtocol)
{
_logger.Debug("Quality and language is highest in profile for preferred protocol, will not delay");
return Decision.Accept();
}
}
var episodeIds = subject.Episodes.Select(e => e.Id);