Send signalr message for episode monitored flag changes

(cherry picked from commit 9e81d41f262fb1f9d798374673b0a0427bf1a6e3)

Closes #1049
This commit is contained in:
Taloth Saldono
2021-09-02 21:12:13 +01:00
committed by ta264
parent 2317665f33
commit 0e5f45a457
6 changed files with 43 additions and 11 deletions
@@ -473,24 +473,24 @@ namespace NzbDrone.Core.Datastore
}
}
protected void ModelCreated(TModel model)
protected void ModelCreated(TModel model, bool forcePublish = false)
{
PublishModelEvent(model, ModelAction.Created);
PublishModelEvent(model, ModelAction.Created, forcePublish);
}
protected void ModelUpdated(TModel model)
protected void ModelUpdated(TModel model, bool forcePublish = false)
{
PublishModelEvent(model, ModelAction.Updated);
PublishModelEvent(model, ModelAction.Updated, forcePublish);
}
protected void ModelDeleted(TModel model)
protected void ModelDeleted(TModel model, bool forcePublish = false)
{
PublishModelEvent(model, ModelAction.Deleted);
PublishModelEvent(model, ModelAction.Deleted, forcePublish);
}
private void PublishModelEvent(TModel model, ModelAction action)
private void PublishModelEvent(TModel model, ModelAction action, bool forcePublish)
{
if (PublishModelEvents)
if (PublishModelEvents || forcePublish)
{
_eventAggregator.PublishEvent(new ModelEvent<TModel>(model, action));
}