mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-16 11:37:58 +02:00
daeb2fc652
New: Update episode status in UI on grab and download
29 lines
814 B
C#
29 lines
814 B
C#
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;
|
|
}
|
|
}
|
|
|
|
} |