mirror of
https://github.com/Prowlarr/Prowlarr
synced 2025-12-26 10:23:48 +01:00
Delay Profile: Fix for when preferred words is null. (#618)
This commit is contained in:
parent
520836f475
commit
d67d405024
1 changed files with 11 additions and 2 deletions
|
|
@ -44,8 +44,17 @@ public virtual Decision IsSatisfiedBy(RemoteMovie subject, SearchCriteriaBase se
|
|||
// Preferred word count
|
||||
var title = subject.Release.Title;
|
||||
var preferredWords = subject.Movie.Profile.Value.PreferredTags;
|
||||
var preferredCount = preferredWords.AsEnumerable().Count(w => title.ToLower().Contains(w.ToLower()));
|
||||
|
||||
var preferredCount = 0;
|
||||
|
||||
if (preferredWords == null)
|
||||
{
|
||||
preferredCount = 1;
|
||||
_logger.Debug("Preferred words is null, setting preffered count to 1.");
|
||||
}
|
||||
else
|
||||
{
|
||||
preferredCount = preferredWords.AsEnumerable().Count(w => title.ToLower().Contains(w.ToLower()));
|
||||
}
|
||||
|
||||
if (delay == 0)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue