Lidarr/src/NzbDrone.Core/Messaging/Commands/Command.cs

46 lines
1.2 KiB
C#
Raw Normal View History

2013-09-11 06:33:47 +00:00
using System;
using System.Text.Json.Serialization;
using NzbDrone.Common.Serializer;
2013-09-11 06:33:47 +00:00
namespace NzbDrone.Core.Messaging.Commands
{
[JsonConverter(typeof(PolymorphicWriteOnlyJsonConverter<Command>))]
public abstract class Command
2013-09-11 06:33:47 +00:00
{
2017-09-04 02:20:56 +00:00
private bool _sendUpdatesToClient;
public virtual bool SendUpdatesToClient
{
get
{
return _sendUpdatesToClient;
}
set
{
_sendUpdatesToClient = value;
}
}
2013-09-11 06:33:47 +00:00
2016-12-09 06:54:15 +00:00
public virtual bool UpdateScheduledTask => true;
public virtual string CompletionMessage => "Completed";
public virtual bool RequiresDiskAccess => false;
public virtual bool IsExclusive => false;
2013-09-11 06:33:47 +00:00
public virtual bool IsTypeExclusive => false;
public string Name { get; private set; }
public DateTime? LastExecutionTime { get; set; }
public DateTime? LastStartTime { get; set; }
public CommandTrigger Trigger { get; set; }
2017-09-04 02:20:56 +00:00
public bool SuppressMessages { get; set; }
2013-09-11 06:33:47 +00:00
public string ClientUserAgent { get; set; }
public Command()
2013-09-11 06:33:47 +00:00
{
Name = GetType().Name.Replace("Command", "");
}
}
}