|
|
@ -2,6 +2,7 @@
|
|
|
|
using System.Linq;
|
|
|
|
using System.Linq;
|
|
|
|
using NLog;
|
|
|
|
using NLog;
|
|
|
|
using NzbDrone.Common;
|
|
|
|
using NzbDrone.Common;
|
|
|
|
|
|
|
|
using NzbDrone.Core.Configuration;
|
|
|
|
using NzbDrone.Core.Instrumentation;
|
|
|
|
using NzbDrone.Core.Instrumentation;
|
|
|
|
using NzbDrone.Core.MediaFiles.Commands;
|
|
|
|
using NzbDrone.Core.MediaFiles.Commands;
|
|
|
|
using NzbDrone.Core.MediaFiles.EpisodeImport;
|
|
|
|
using NzbDrone.Core.MediaFiles.EpisodeImport;
|
|
|
@ -25,17 +26,21 @@ namespace NzbDrone.Core.MediaFiles
|
|
|
|
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 Logger _logger;
|
|
|
|
private readonly Logger _logger;
|
|
|
|
|
|
|
|
|
|
|
|
public DiskScanService(IDiskProvider diskProvider,
|
|
|
|
public DiskScanService(IDiskProvider diskProvider,
|
|
|
|
IMakeImportDecision importDecisionMaker,
|
|
|
|
IMakeImportDecision importDecisionMaker,
|
|
|
|
IImportApprovedEpisodes importApprovedEpisodes,
|
|
|
|
IImportApprovedEpisodes importApprovedEpisodes,
|
|
|
|
ICommandExecutor commandExecutor, Logger logger)
|
|
|
|
ICommandExecutor commandExecutor,
|
|
|
|
|
|
|
|
IConfigService configService,
|
|
|
|
|
|
|
|
Logger logger)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_diskProvider = diskProvider;
|
|
|
|
_diskProvider = diskProvider;
|
|
|
|
_importDecisionMaker = importDecisionMaker;
|
|
|
|
_importDecisionMaker = importDecisionMaker;
|
|
|
|
_importApprovedEpisodes = importApprovedEpisodes;
|
|
|
|
_importApprovedEpisodes = importApprovedEpisodes;
|
|
|
|
_commandExecutor = commandExecutor;
|
|
|
|
_commandExecutor = commandExecutor;
|
|
|
|
|
|
|
|
_configService = configService;
|
|
|
|
_logger = logger;
|
|
|
|
_logger = logger;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -46,6 +51,14 @@ namespace NzbDrone.Core.MediaFiles
|
|
|
|
|
|
|
|
|
|
|
|
if (!_diskProvider.FolderExists(series.Path))
|
|
|
|
if (!_diskProvider.FolderExists(series.Path))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
if (_configService.CreateEmptySeriesFolders &&
|
|
|
|
|
|
|
|
_diskProvider.FolderExists(_diskProvider.GetParentFolder(series.Path)))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_logger.Debug("Creating missing series folder: {0}", series.Path);
|
|
|
|
|
|
|
|
_diskProvider.CreateFolder(series.Path);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_logger.Debug("Series folder doesn't exist: {0}", series.Path);
|
|
|
|
_logger.Debug("Series folder doesn't exist: {0}", series.Path);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|