parent
320bfeec16
commit
e8c925274a
@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using Equ;
|
||||
using NzbDrone.Core.ThingiProvider;
|
||||
using NzbDrone.Core.Validation;
|
||||
|
||||
namespace NzbDrone.Core.Download.Clients
|
||||
{
|
||||
public abstract class DownloadClientSettingsBase<TSettings> : IProviderConfig, IEquatable<TSettings>
|
||||
where TSettings : DownloadClientSettingsBase<TSettings>
|
||||
{
|
||||
private static readonly MemberwiseEqualityComparer<TSettings> Comparer = MemberwiseEqualityComparer<TSettings>.ByProperties;
|
||||
|
||||
public abstract NzbDroneValidationResult Validate();
|
||||
|
||||
public bool Equals(TSettings other)
|
||||
{
|
||||
return Comparer.Equals(this as TSettings, other);
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
return Equals(obj as TSettings);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Comparer.GetHashCode(this as TSettings);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,13 +1,34 @@
|
||||
using System;
|
||||
using Equ;
|
||||
using NzbDrone.Core.Indexers;
|
||||
using NzbDrone.Core.ThingiProvider;
|
||||
|
||||
namespace NzbDrone.Core.Download
|
||||
{
|
||||
public class DownloadClientDefinition : ProviderDefinition
|
||||
public class DownloadClientDefinition : ProviderDefinition, IEquatable<DownloadClientDefinition>
|
||||
{
|
||||
private static readonly MemberwiseEqualityComparer<DownloadClientDefinition> Comparer = MemberwiseEqualityComparer<DownloadClientDefinition>.ByProperties;
|
||||
|
||||
[MemberwiseEqualityIgnore]
|
||||
public DownloadProtocol Protocol { get; set; }
|
||||
|
||||
public int Priority { get; set; } = 1;
|
||||
public bool RemoveCompletedDownloads { get; set; } = true;
|
||||
public bool RemoveFailedDownloads { get; set; } = true;
|
||||
|
||||
public bool Equals(DownloadClientDefinition other)
|
||||
{
|
||||
return Comparer.Equals(this, other);
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
return Equals(obj as DownloadClientDefinition);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Comparer.GetHashCode(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using Equ;
|
||||
using NzbDrone.Core.ThingiProvider;
|
||||
using NzbDrone.Core.Validation;
|
||||
|
||||
namespace NzbDrone.Core.ImportLists
|
||||
{
|
||||
public abstract class ImportListSettingsBase<TSettings> : IProviderConfig, IEquatable<TSettings>
|
||||
where TSettings : ImportListSettingsBase<TSettings>
|
||||
{
|
||||
private static readonly MemberwiseEqualityComparer<TSettings> Comparer = MemberwiseEqualityComparer<TSettings>.ByProperties;
|
||||
|
||||
public abstract NzbDroneValidationResult Validate();
|
||||
|
||||
public bool Equals(TSettings other)
|
||||
{
|
||||
return Comparer.Equals(this as TSettings, other);
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
return Equals(obj as TSettings);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Comparer.GetHashCode(this as TSettings);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using Equ;
|
||||
using NzbDrone.Core.ThingiProvider;
|
||||
using NzbDrone.Core.Validation;
|
||||
|
||||
namespace NzbDrone.Core.Notifications
|
||||
{
|
||||
public abstract class NotificationSettingsBase<TSettings> : IProviderConfig, IEquatable<TSettings>
|
||||
where TSettings : NotificationSettingsBase<TSettings>
|
||||
{
|
||||
private static readonly MemberwiseEqualityComparer<TSettings> Comparer = MemberwiseEqualityComparer<TSettings>.ByProperties;
|
||||
|
||||
public abstract NzbDroneValidationResult Validate();
|
||||
|
||||
public bool Equals(TSettings other)
|
||||
{
|
||||
return Comparer.Equals(this as TSettings, other);
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
return Equals(obj as TSettings);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Comparer.GetHashCode(this as TSettings);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue