mirror of
https://github.com/Radarr/Radarr.git
synced 2024-10-27 06:02:33 +01:00
Add indexer default priority as constant
This commit is contained in:
parent
136075d233
commit
8fd8128641
@ -145,7 +145,7 @@ private List<DownloadDecision> DeDupeDecisions(List<DownloadDecision> decisions)
|
|||||||
{
|
{
|
||||||
// De-dupe reports by guid so duplicate results aren't returned. Pick the one with the least rejections and higher indexer priority.
|
// De-dupe reports by guid so duplicate results aren't returned. Pick the one with the least rejections and higher indexer priority.
|
||||||
return decisions.GroupBy(d => d.RemoteMovie.Release.Guid)
|
return decisions.GroupBy(d => d.RemoteMovie.Release.Guid)
|
||||||
.Select(d => d.OrderBy(v => v.Rejections.Count()).ThenBy(v => v.RemoteMovie?.Release?.IndexerPriority ?? 100).First())
|
.Select(d => d.OrderBy(v => v.Rejections.Count()).ThenBy(v => v.RemoteMovie?.Release?.IndexerPriority ?? IndexerDefinition.DefaultPriority).First())
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,13 @@ namespace NzbDrone.Core.Indexers
|
|||||||
{
|
{
|
||||||
public class IndexerDefinition : ProviderDefinition
|
public class IndexerDefinition : ProviderDefinition
|
||||||
{
|
{
|
||||||
|
public const int DefaultPriority = 25;
|
||||||
|
|
||||||
|
public IndexerDefinition()
|
||||||
|
{
|
||||||
|
Priority = DefaultPriority;
|
||||||
|
}
|
||||||
|
|
||||||
public bool EnableRss { get; set; }
|
public bool EnableRss { get; set; }
|
||||||
public bool EnableAutomaticSearch { get; set; }
|
public bool EnableAutomaticSearch { get; set; }
|
||||||
public bool EnableInteractiveSearch { get; set; }
|
public bool EnableInteractiveSearch { get; set; }
|
||||||
@ -11,7 +18,7 @@ public class IndexerDefinition : ProviderDefinition
|
|||||||
public DownloadProtocol Protocol { get; set; }
|
public DownloadProtocol Protocol { get; set; }
|
||||||
public bool SupportsRss { get; set; }
|
public bool SupportsRss { get; set; }
|
||||||
public bool SupportsSearch { get; set; }
|
public bool SupportsSearch { get; set; }
|
||||||
public int Priority { get; set; } = 25;
|
public int Priority { get; set; }
|
||||||
|
|
||||||
public override bool Enable => EnableRss || EnableAutomaticSearch || EnableInteractiveSearch;
|
public override bool Enable => EnableRss || EnableAutomaticSearch || EnableInteractiveSearch;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user