New: Collection Refresh Complete Event to trigger root folder check for collections

pull/9821/head^2
Bogdan 8 months ago
parent e84df18e8d
commit cae58d620b

@ -19,7 +19,6 @@ namespace NzbDrone.Core.HealthCheck.Checks
[CheckOn(typeof(ProviderDeletedEvent<IDownloadClient>))]
[CheckOn(typeof(ModelEvent<RootFolder>))]
[CheckOn(typeof(ModelEvent<RemotePathMapping>))]
public class DownloadClientRootFolderCheck : HealthCheckBase, IProvideHealthCheck
{
private readonly IProvideDownloadClient _downloadClientProvider;

@ -5,10 +5,12 @@ using NzbDrone.Common.Extensions;
using NzbDrone.Core.Datastore.Events;
using NzbDrone.Core.Localization;
using NzbDrone.Core.Movies.Collections;
using NzbDrone.Core.Movies.Events;
using NzbDrone.Core.RootFolders;
namespace NzbDrone.Core.HealthCheck.Checks
{
[CheckOn(typeof(CollectionRefreshCompleteEvent))]
[CheckOn(typeof(ModelEvent<RootFolder>))]
public class MovieCollectionRootFolderCheck : HealthCheckBase
{

@ -0,0 +1,8 @@
using NzbDrone.Common.Messaging;
namespace NzbDrone.Core.Movies.Events
{
public class CollectionRefreshCompleteEvent : IEvent
{
}
}

@ -6,9 +6,11 @@ using NzbDrone.Common.Instrumentation.Extensions;
using NzbDrone.Core.Exceptions;
using NzbDrone.Core.ImportLists.ImportExclusions;
using NzbDrone.Core.Messaging.Commands;
using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.MetadataSource;
using NzbDrone.Core.Movies.Collections;
using NzbDrone.Core.Movies.Commands;
using NzbDrone.Core.Movies.Events;
namespace NzbDrone.Core.Movies
{
@ -20,6 +22,7 @@ namespace NzbDrone.Core.Movies
private readonly IMovieMetadataService _movieMetadataService;
private readonly IAddMovieService _addMovieService;
private readonly IImportExclusionsService _importExclusionService;
private readonly IEventAggregator _eventAggregator;
private readonly Logger _logger;
@ -29,6 +32,7 @@ namespace NzbDrone.Core.Movies
IMovieMetadataService movieMetadataService,
IAddMovieService addMovieService,
IImportExclusionsService importExclusionsService,
IEventAggregator eventAggregator,
Logger logger)
{
_movieInfo = movieInfo;
@ -37,6 +41,7 @@ namespace NzbDrone.Core.Movies
_movieMetadataService = movieMetadataService;
_addMovieService = addMovieService;
_importExclusionService = importExclusionsService;
_eventAggregator = eventAggregator;
_logger = logger;
}
@ -179,6 +184,8 @@ namespace NzbDrone.Core.Movies
}
}
}
_eventAggregator.PublishEvent(new CollectionRefreshCompleteEvent());
}
}
}

Loading…
Cancel
Save