1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-20 21:54:58 -04:00

Send signalr message for episode monitored flag changes

This commit is contained in:
Taloth Saldono
2021-05-16 17:08:08 +02:00
parent dab1834960
commit 9e81d41f26
9 changed files with 88 additions and 44 deletions
@@ -279,24 +279,24 @@ namespace NzbDrone.Core.Datastore
.Take(pagingSpec.PageSize);
}
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));
}