|
|
@ -1,4 +1,5 @@
|
|
|
|
using System.IO;
|
|
|
|
using System;
|
|
|
|
|
|
|
|
using System.IO;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Linq;
|
|
|
|
using NLog;
|
|
|
|
using NLog;
|
|
|
|
using NzbDrone.Common;
|
|
|
|
using NzbDrone.Common;
|
|
|
@ -21,13 +22,15 @@ namespace NzbDrone.Core.MediaFiles
|
|
|
|
|
|
|
|
|
|
|
|
public class DiskScanService :
|
|
|
|
public class DiskScanService :
|
|
|
|
IDiskScanService,
|
|
|
|
IDiskScanService,
|
|
|
|
IHandle<SeriesUpdatedEvent>
|
|
|
|
IHandle<SeriesUpdatedEvent>,
|
|
|
|
|
|
|
|
IExecute<RescanSeriesCommand>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
private readonly IDiskProvider _diskProvider;
|
|
|
|
private readonly IDiskProvider _diskProvider;
|
|
|
|
private readonly IMakeImportDecision _importDecisionMaker;
|
|
|
|
private readonly IMakeImportDecision _importDecisionMaker;
|
|
|
|
private readonly IImportApprovedEpisodes _importApprovedEpisodes;
|
|
|
|
private readonly IImportApprovedEpisodes _importApprovedEpisodes;
|
|
|
|
private readonly ICommandExecutor _commandExecutor;
|
|
|
|
private readonly ICommandExecutor _commandExecutor;
|
|
|
|
private readonly IConfigService _configService;
|
|
|
|
private readonly IConfigService _configService;
|
|
|
|
|
|
|
|
private readonly ISeriesService _seriesService;
|
|
|
|
private readonly Logger _logger;
|
|
|
|
private readonly Logger _logger;
|
|
|
|
|
|
|
|
|
|
|
|
public DiskScanService(IDiskProvider diskProvider,
|
|
|
|
public DiskScanService(IDiskProvider diskProvider,
|
|
|
@ -35,6 +38,7 @@ namespace NzbDrone.Core.MediaFiles
|
|
|
|
IImportApprovedEpisodes importApprovedEpisodes,
|
|
|
|
IImportApprovedEpisodes importApprovedEpisodes,
|
|
|
|
ICommandExecutor commandExecutor,
|
|
|
|
ICommandExecutor commandExecutor,
|
|
|
|
IConfigService configService,
|
|
|
|
IConfigService configService,
|
|
|
|
|
|
|
|
ISeriesService seriesService,
|
|
|
|
Logger logger)
|
|
|
|
Logger logger)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_diskProvider = diskProvider;
|
|
|
|
_diskProvider = diskProvider;
|
|
|
@ -42,6 +46,7 @@ namespace NzbDrone.Core.MediaFiles
|
|
|
|
_importApprovedEpisodes = importApprovedEpisodes;
|
|
|
|
_importApprovedEpisodes = importApprovedEpisodes;
|
|
|
|
_commandExecutor = commandExecutor;
|
|
|
|
_commandExecutor = commandExecutor;
|
|
|
|
_configService = configService;
|
|
|
|
_configService = configService;
|
|
|
|
|
|
|
|
_seriesService = seriesService;
|
|
|
|
_logger = logger;
|
|
|
|
_logger = logger;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -90,5 +95,12 @@ namespace NzbDrone.Core.MediaFiles
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Scan(message.Series);
|
|
|
|
Scan(message.Series);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void Execute(RescanSeriesCommand message)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var series = _seriesService.GetSeries(message.SeriesId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Scan(series);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|