2013-09-11 06:33:47 +00:00
|
|
|
using System;
|
2021-02-03 21:20:06 +00:00
|
|
|
using System.Text.Json.Serialization;
|
|
|
|
using NzbDrone.Common.Serializer;
|
2013-09-11 06:33:47 +00:00
|
|
|
|
|
|
|
namespace NzbDrone.Core.Messaging.Commands
|
|
|
|
{
|
2021-02-03 21:20:06 +00:00
|
|
|
[JsonConverter(typeof(PolymorphicWriteOnlyJsonConverter<Command>))]
|
2015-01-16 00:30:09 +00:00
|
|
|
public abstract class Command
|
2013-09-11 06:33:47 +00:00
|
|
|
{
|
2018-11-23 07:03:32 +00:00
|
|
|
private bool _sendUpdatesToClient;
|
2013-09-11 06:33:47 +00:00
|
|
|
|
2018-11-23 07:03:32 +00:00
|
|
|
public virtual bool SendUpdatesToClient
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return _sendUpdatesToClient;
|
|
|
|
}
|
2015-07-31 16:26:06 +00:00
|
|
|
|
2018-11-23 07:03:32 +00:00
|
|
|
set
|
|
|
|
{
|
|
|
|
_sendUpdatesToClient = value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public virtual bool UpdateScheduledTask => true;
|
2016-12-09 06:54:15 +00:00
|
|
|
public virtual string CompletionMessage => "Completed";
|
2018-11-23 07:03:32 +00:00
|
|
|
public virtual bool RequiresDiskAccess => false;
|
|
|
|
public virtual bool IsExclusive => false;
|
2020-09-04 02:50:56 +00:00
|
|
|
public virtual bool IsTypeExclusive => false;
|
2013-09-11 06:33:47 +00:00
|
|
|
|
2015-10-03 17:45:26 +00:00
|
|
|
public string Name { get; private set; }
|
2014-04-12 20:49:41 +00:00
|
|
|
public DateTime? LastExecutionTime { get; set; }
|
2019-12-15 05:34:45 +00:00
|
|
|
public DateTime? LastStartTime { get; set; }
|
2015-01-16 00:30:09 +00:00
|
|
|
public CommandTrigger Trigger { get; set; }
|
2018-11-23 07:03:32 +00:00
|
|
|
public bool SuppressMessages { get; set; }
|
2013-09-11 06:33:47 +00:00
|
|
|
|
2021-05-18 01:45:23 +00:00
|
|
|
public string ClientUserAgent { get; set; }
|
|
|
|
|
2015-01-16 00:30:09 +00:00
|
|
|
public Command()
|
2013-09-11 06:33:47 +00:00
|
|
|
{
|
|
|
|
Name = GetType().Name.Replace("Command", "");
|
|
|
|
}
|
|
|
|
}
|
2015-01-16 00:30:09 +00:00
|
|
|
}
|