mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
signalr cleanup
This commit is contained in:
parent
feda4a9b67
commit
25e2c98c45
219 changed files with 2035 additions and 1495 deletions
29
NzbDrone.Api/ResourceChangeMessage.cs
Normal file
29
NzbDrone.Api/ResourceChangeMessage.cs
Normal file
|
@ -0,0 +1,29 @@
|
|||
using System;
|
||||
using NzbDrone.Api.REST;
|
||||
using NzbDrone.Core.Datastore.Events;
|
||||
|
||||
namespace NzbDrone.Api
|
||||
{
|
||||
public class ResourceChangeMessage<TResource> where TResource : RestResource
|
||||
{
|
||||
public TResource Resource { get; private set; }
|
||||
public ModelAction Action { get; private set; }
|
||||
|
||||
public ResourceChangeMessage(ModelAction action)
|
||||
{
|
||||
if (action != ModelAction.Deleted || action != ModelAction.Sync)
|
||||
{
|
||||
throw new InvalidOperationException("Resource message without a resource needs to have Delete or Sync as action");
|
||||
}
|
||||
|
||||
Action = action;
|
||||
}
|
||||
|
||||
public ResourceChangeMessage(TResource resource, ModelAction action)
|
||||
{
|
||||
Resource = resource;
|
||||
Action = action;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue