2024-04-14 04:16:26 +00:00
|
|
|
using System;
|
|
|
|
using Equ;
|
2023-04-14 23:44:49 +00:00
|
|
|
using NzbDrone.Core.ThingiProvider;
|
2013-05-19 23:17:32 +00:00
|
|
|
|
|
|
|
namespace NzbDrone.Core.Notifications
|
|
|
|
{
|
2024-04-14 04:16:26 +00:00
|
|
|
public class NotificationDefinition : ProviderDefinition, IEquatable<NotificationDefinition>
|
2013-09-21 06:39:26 +00:00
|
|
|
{
|
2024-04-14 04:16:26 +00:00
|
|
|
private static readonly MemberwiseEqualityComparer<NotificationDefinition> Comparer = MemberwiseEqualityComparer<NotificationDefinition>.ByProperties;
|
|
|
|
|
2015-05-20 23:22:10 +00:00
|
|
|
public bool OnGrab { get; set; }
|
|
|
|
public bool OnDownload { get; set; }
|
|
|
|
public bool OnUpgrade { get; set; }
|
|
|
|
public bool OnRename { get; set; }
|
2023-04-14 23:44:49 +00:00
|
|
|
public bool OnSeriesAdd { get; set; }
|
2021-01-24 09:21:29 +00:00
|
|
|
public bool OnSeriesDelete { get; set; }
|
|
|
|
public bool OnEpisodeFileDelete { get; set; }
|
2021-01-30 22:54:26 +00:00
|
|
|
public bool OnEpisodeFileDeleteForUpgrade { get; set; }
|
2019-08-08 01:45:29 +00:00
|
|
|
public bool OnHealthIssue { get; set; }
|
2024-04-14 04:16:26 +00:00
|
|
|
public bool IncludeHealthWarnings { get; set; }
|
2023-05-08 01:57:14 +00:00
|
|
|
public bool OnHealthRestored { get; set; }
|
2022-01-23 21:24:34 +00:00
|
|
|
public bool OnApplicationUpdate { get; set; }
|
2022-10-17 16:19:54 +00:00
|
|
|
public bool OnManualInteractionRequired { get; set; }
|
2024-04-14 04:16:26 +00:00
|
|
|
|
|
|
|
[MemberwiseEqualityIgnore]
|
2015-05-20 23:22:10 +00:00
|
|
|
public bool SupportsOnGrab { get; set; }
|
2024-04-14 04:16:26 +00:00
|
|
|
|
|
|
|
[MemberwiseEqualityIgnore]
|
2015-05-20 23:22:10 +00:00
|
|
|
public bool SupportsOnDownload { get; set; }
|
2024-04-14 04:16:26 +00:00
|
|
|
|
|
|
|
[MemberwiseEqualityIgnore]
|
2015-05-20 23:22:10 +00:00
|
|
|
public bool SupportsOnUpgrade { get; set; }
|
2024-04-14 04:16:26 +00:00
|
|
|
|
|
|
|
[MemberwiseEqualityIgnore]
|
2015-05-20 23:22:10 +00:00
|
|
|
public bool SupportsOnRename { get; set; }
|
2024-04-14 04:16:26 +00:00
|
|
|
|
|
|
|
[MemberwiseEqualityIgnore]
|
2023-04-14 23:44:49 +00:00
|
|
|
public bool SupportsOnSeriesAdd { get; set; }
|
2024-04-14 04:16:26 +00:00
|
|
|
|
|
|
|
[MemberwiseEqualityIgnore]
|
2021-01-24 09:21:29 +00:00
|
|
|
public bool SupportsOnSeriesDelete { get; set; }
|
2024-04-14 04:16:26 +00:00
|
|
|
|
|
|
|
[MemberwiseEqualityIgnore]
|
2021-01-24 09:21:29 +00:00
|
|
|
public bool SupportsOnEpisodeFileDelete { get; set; }
|
2024-04-14 04:16:26 +00:00
|
|
|
|
|
|
|
[MemberwiseEqualityIgnore]
|
2021-01-30 22:54:26 +00:00
|
|
|
public bool SupportsOnEpisodeFileDeleteForUpgrade { get; set; }
|
2024-04-14 04:16:26 +00:00
|
|
|
|
|
|
|
[MemberwiseEqualityIgnore]
|
2019-08-08 01:45:29 +00:00
|
|
|
public bool SupportsOnHealthIssue { get; set; }
|
2024-04-14 04:16:26 +00:00
|
|
|
|
|
|
|
[MemberwiseEqualityIgnore]
|
2023-05-08 01:57:14 +00:00
|
|
|
public bool SupportsOnHealthRestored { get; set; }
|
2024-04-14 04:16:26 +00:00
|
|
|
|
|
|
|
[MemberwiseEqualityIgnore]
|
2022-01-23 21:24:34 +00:00
|
|
|
public bool SupportsOnApplicationUpdate { get; set; }
|
2024-04-14 04:16:26 +00:00
|
|
|
|
|
|
|
[MemberwiseEqualityIgnore]
|
2022-10-17 16:19:54 +00:00
|
|
|
public bool SupportsOnManualInteractionRequired { get; set; }
|
2014-07-04 08:09:48 +00:00
|
|
|
|
2024-04-14 04:16:26 +00:00
|
|
|
[MemberwiseEqualityIgnore]
|
2024-01-24 09:38:43 +00:00
|
|
|
public override bool Enable => OnGrab || OnDownload || (OnDownload && OnUpgrade) || OnSeriesAdd || OnSeriesDelete || OnEpisodeFileDelete || (OnEpisodeFileDelete && OnEpisodeFileDeleteForUpgrade) || OnHealthIssue || OnHealthRestored || OnApplicationUpdate || OnManualInteractionRequired;
|
2024-04-14 04:16:26 +00:00
|
|
|
|
|
|
|
public bool Equals(NotificationDefinition other)
|
|
|
|
{
|
|
|
|
return Comparer.Equals(this, other);
|
|
|
|
}
|
|
|
|
|
|
|
|
public override bool Equals(object obj)
|
|
|
|
{
|
|
|
|
return Equals(obj as NotificationDefinition);
|
|
|
|
}
|
|
|
|
|
|
|
|
public override int GetHashCode()
|
|
|
|
{
|
|
|
|
return Comparer.GetHashCode(this);
|
|
|
|
}
|
2013-09-21 06:39:26 +00:00
|
|
|
}
|
2014-07-04 08:09:48 +00:00
|
|
|
}
|