mirror of
https://github.com/Radarr/Radarr
synced 2025-02-25 15:43:08 +00:00
Delay Profile: Delay for at least 1 preferred word
This commit is contained in:
parent
b6235e99c8
commit
0d647ffb9a
1 changed files with 6 additions and 3 deletions
|
@ -68,11 +68,14 @@ public virtual Decision IsSatisfiedBy(RemoteMovie subject, SearchCriteriaBase se
|
||||||
|
|
||||||
// If quality meets or exceeds the best allowed quality in the profile accept it immediately
|
// If quality meets or exceeds the best allowed quality in the profile accept it immediately
|
||||||
var bestQualityInProfile = new QualityModel(profile.LastAllowedQuality());
|
var bestQualityInProfile = new QualityModel(profile.LastAllowedQuality());
|
||||||
var isBestInProfile = comparer.Compare(subject.ParsedMovieInfo.Quality, bestQualityInProfile) >= 0;
|
var isBestInProfile = comparer.Compare(subject.ParsedMovieInfo.Quality, bestQualityInProfile) >= 0;
|
||||||
|
var title = subject.Release.Title;
|
||||||
|
var preferredWords = subject.Movie.Profile.Value.PreferredTags;
|
||||||
|
var num = preferredWords.AsEnumerable().Count(w => title.ToLower().Contains(w.ToLower()));
|
||||||
|
|
||||||
if (isBestInProfile && isPreferredProtocol)
|
if (isBestInProfile && isPreferredProtocol && (num > 0 || preferredWords == null))
|
||||||
{
|
{
|
||||||
_logger.Debug("Quality is highest in profile for preferred protocol, will not delay");
|
_logger.Debug("Quality is highest in profile for preferred protocol and preferred word count is {0}, will not delay",num);
|
||||||
return Decision.Accept();
|
return Decision.Accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue