mirror of https://github.com/Sonarr/Sonarr
Compare commits
2 Commits
dc12b255bc
...
1c01452952
Author | SHA1 | Date |
---|---|---|
Bogdan | 1c01452952 | |
Bogdan | 2e784c7f36 |
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using Equ;
|
||||
using FluentValidation;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Core.Annotations;
|
||||
|
@ -40,10 +41,12 @@ namespace NzbDrone.Core.Indexers.Torznab
|
|||
}
|
||||
}
|
||||
|
||||
public class TorznabSettings : NewznabSettings, ITorrentIndexerSettings
|
||||
public class TorznabSettings : NewznabSettings, ITorrentIndexerSettings, IEquatable<TorznabSettings>
|
||||
{
|
||||
private static readonly TorznabSettingsValidator Validator = new ();
|
||||
|
||||
private static readonly MemberwiseEqualityComparer<TorznabSettings> Comparer = MemberwiseEqualityComparer<TorznabSettings>.ByProperties;
|
||||
|
||||
public TorznabSettings()
|
||||
{
|
||||
MinimumSeeders = IndexerDefaults.MINIMUM_SEEDERS;
|
||||
|
@ -62,5 +65,20 @@ namespace NzbDrone.Core.Indexers.Torznab
|
|||
{
|
||||
return new NzbDroneValidationResult(Validator.Validate(this));
|
||||
}
|
||||
|
||||
public bool Equals(TorznabSettings other)
|
||||
{
|
||||
return Comparer.Equals(this, other);
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
return Equals(obj as TorznabSettings);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Comparer.GetHashCode(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue