2024-04-14 04:16:26 +00:00
|
|
|
using System;
|
|
|
|
using Equ;
|
2021-12-22 04:48:20 +00:00
|
|
|
using NzbDrone.Core.ThingiProvider;
|
2013-02-21 07:07:34 +00:00
|
|
|
|
|
|
|
namespace NzbDrone.Core.Indexers
|
|
|
|
{
|
2024-04-14 04:16:26 +00:00
|
|
|
public class IndexerDefinition : ProviderDefinition, IEquatable<IndexerDefinition>
|
2013-02-21 07:07:34 +00:00
|
|
|
{
|
2024-04-14 04:16:26 +00:00
|
|
|
private static readonly MemberwiseEqualityComparer<IndexerDefinition> Comparer = MemberwiseEqualityComparer<IndexerDefinition>.ByProperties;
|
|
|
|
|
2023-07-26 08:36:59 +00:00
|
|
|
public const int DefaultPriority = 25;
|
|
|
|
|
|
|
|
public IndexerDefinition()
|
|
|
|
{
|
|
|
|
Priority = DefaultPriority;
|
|
|
|
}
|
|
|
|
|
2024-04-14 04:16:26 +00:00
|
|
|
[MemberwiseEqualityIgnore]
|
|
|
|
public DownloadProtocol Protocol { get; set; }
|
|
|
|
|
|
|
|
[MemberwiseEqualityIgnore]
|
|
|
|
public bool SupportsRss { get; set; }
|
|
|
|
|
|
|
|
[MemberwiseEqualityIgnore]
|
|
|
|
public bool SupportsSearch { get; set; }
|
|
|
|
|
2015-10-03 17:45:26 +00:00
|
|
|
public bool EnableRss { get; set; }
|
2019-06-14 03:54:25 +00:00
|
|
|
public bool EnableAutomaticSearch { get; set; }
|
|
|
|
public bool EnableInteractiveSearch { get; set; }
|
2021-12-22 04:48:20 +00:00
|
|
|
public int DownloadClientId { get; set; }
|
2023-07-26 08:36:59 +00:00
|
|
|
public int Priority { get; set; }
|
2014-08-18 02:25:00 +00:00
|
|
|
|
2024-04-14 04:16:26 +00:00
|
|
|
[MemberwiseEqualityIgnore]
|
2019-06-14 03:54:25 +00:00
|
|
|
public override bool Enable => EnableRss || EnableAutomaticSearch || EnableInteractiveSearch;
|
2015-06-27 09:43:17 +00:00
|
|
|
|
2024-04-14 04:16:26 +00:00
|
|
|
[MemberwiseEqualityIgnore]
|
2015-06-27 09:43:17 +00:00
|
|
|
public IndexerStatus Status { get; set; }
|
2024-04-14 04:16:26 +00:00
|
|
|
|
|
|
|
public bool Equals(IndexerDefinition other)
|
|
|
|
{
|
|
|
|
return Comparer.Equals(this, other);
|
|
|
|
}
|
|
|
|
|
|
|
|
public override bool Equals(object obj)
|
|
|
|
{
|
|
|
|
return Equals(obj as IndexerDefinition);
|
|
|
|
}
|
|
|
|
|
|
|
|
public override int GetHashCode()
|
|
|
|
{
|
|
|
|
return Comparer.GetHashCode(this);
|
|
|
|
}
|
2013-02-21 07:07:34 +00:00
|
|
|
}
|
2014-07-04 08:09:48 +00:00
|
|
|
}
|