diff --git a/src/NzbDrone.Core/MediaFiles/DiskScanService.cs b/src/NzbDrone.Core/MediaFiles/DiskScanService.cs
index 0b1e51be6..79d53a9a8 100644
--- a/src/NzbDrone.Core/MediaFiles/DiskScanService.cs
+++ b/src/NzbDrone.Core/MediaFiles/DiskScanService.cs
@@ -8,6 +8,7 @@ using NzbDrone.Core.Configuration;
using NzbDrone.Core.Instrumentation;
using NzbDrone.Core.MediaFiles.Commands;
using NzbDrone.Core.MediaFiles.EpisodeImport;
+using NzbDrone.Core.MediaFiles.Events;
using NzbDrone.Core.Messaging.Commands;
using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.Tv;
@@ -31,15 +32,17 @@ namespace NzbDrone.Core.MediaFiles
private readonly ICommandExecutor _commandExecutor;
private readonly IConfigService _configService;
private readonly ISeriesService _seriesService;
+ private readonly IEventAggregator _eventAggregator;
private readonly Logger _logger;
public DiskScanService(IDiskProvider diskProvider,
- IMakeImportDecision importDecisionMaker,
- IImportApprovedEpisodes importApprovedEpisodes,
- ICommandExecutor commandExecutor,
- IConfigService configService,
- ISeriesService seriesService,
- Logger logger)
+ IMakeImportDecision importDecisionMaker,
+ IImportApprovedEpisodes importApprovedEpisodes,
+ ICommandExecutor commandExecutor,
+ IConfigService configService,
+ ISeriesService seriesService,
+ IEventAggregator eventAggregator,
+ Logger logger)
{
_diskProvider = diskProvider;
_importDecisionMaker = importDecisionMaker;
@@ -47,6 +50,7 @@ namespace NzbDrone.Core.MediaFiles
_commandExecutor = commandExecutor;
_configService = configService;
_seriesService = seriesService;
+ _eventAggregator = eventAggregator;
_logger = logger;
}
@@ -75,7 +79,9 @@ namespace NzbDrone.Core.MediaFiles
var decisions = _importDecisionMaker.GetImportDecisions(mediaFileList, series, false);
_importApprovedEpisodes.Import(decisions);
+
_logger.Info("Completed scanning disk for {0}", series.Title);
+ _eventAggregator.PublishEvent(new SeriesScannedEvent(series));
}
public string[] GetVideoFiles(string path, bool allDirectories = true)
diff --git a/src/NzbDrone.Core/MediaFiles/Events/SeriesScannedEvent.cs b/src/NzbDrone.Core/MediaFiles/Events/SeriesScannedEvent.cs
new file mode 100644
index 000000000..f82de5214
--- /dev/null
+++ b/src/NzbDrone.Core/MediaFiles/Events/SeriesScannedEvent.cs
@@ -0,0 +1,15 @@
+using NzbDrone.Common.Messaging;
+using NzbDrone.Core.Tv;
+
+namespace NzbDrone.Core.MediaFiles.Events
+{
+ public class SeriesScannedEvent : IEvent
+ {
+ public Series Series { get; private set; }
+
+ public SeriesScannedEvent(Series series)
+ {
+ Series = series;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/NzbDrone.Core/NzbDrone.Core.csproj b/src/NzbDrone.Core/NzbDrone.Core.csproj
index 166fee736..640fef368 100644
--- a/src/NzbDrone.Core/NzbDrone.Core.csproj
+++ b/src/NzbDrone.Core/NzbDrone.Core.csproj
@@ -317,6 +317,7 @@
+