|
|
@ -5,6 +5,7 @@ using NLog;
|
|
|
|
using NzbDrone.Common.Disk;
|
|
|
|
using NzbDrone.Common.Disk;
|
|
|
|
using NzbDrone.Common.Extensions;
|
|
|
|
using NzbDrone.Common.Extensions;
|
|
|
|
using NzbDrone.Common.Instrumentation.Extensions;
|
|
|
|
using NzbDrone.Common.Instrumentation.Extensions;
|
|
|
|
|
|
|
|
using NzbDrone.Core.Download;
|
|
|
|
using NzbDrone.Core.Download.TrackedDownloads;
|
|
|
|
using NzbDrone.Core.Download.TrackedDownloads;
|
|
|
|
using NzbDrone.Core.MediaFiles.Commands;
|
|
|
|
using NzbDrone.Core.MediaFiles.Commands;
|
|
|
|
using NzbDrone.Core.MediaFiles.MovieImport;
|
|
|
|
using NzbDrone.Core.MediaFiles.MovieImport;
|
|
|
@ -17,16 +18,19 @@ namespace NzbDrone.Core.MediaFiles
|
|
|
|
private readonly IDownloadedMovieImportService _downloadedMovieImportService;
|
|
|
|
private readonly IDownloadedMovieImportService _downloadedMovieImportService;
|
|
|
|
private readonly ITrackedDownloadService _trackedDownloadService;
|
|
|
|
private readonly ITrackedDownloadService _trackedDownloadService;
|
|
|
|
private readonly IDiskProvider _diskProvider;
|
|
|
|
private readonly IDiskProvider _diskProvider;
|
|
|
|
|
|
|
|
private readonly ICompletedDownloadService _completedDownloadService;
|
|
|
|
private readonly Logger _logger;
|
|
|
|
private readonly Logger _logger;
|
|
|
|
|
|
|
|
|
|
|
|
public DownloadedMovieCommandService(IDownloadedMovieImportService downloadedMovieImportService,
|
|
|
|
public DownloadedMovieCommandService(IDownloadedMovieImportService downloadedMovieImportService,
|
|
|
|
ITrackedDownloadService trackedDownloadService,
|
|
|
|
ITrackedDownloadService trackedDownloadService,
|
|
|
|
IDiskProvider diskProvider,
|
|
|
|
IDiskProvider diskProvider,
|
|
|
|
|
|
|
|
ICompletedDownloadService completedDownloadService,
|
|
|
|
Logger logger)
|
|
|
|
Logger logger)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_downloadedMovieImportService = downloadedMovieImportService;
|
|
|
|
_downloadedMovieImportService = downloadedMovieImportService;
|
|
|
|
_trackedDownloadService = trackedDownloadService;
|
|
|
|
_trackedDownloadService = trackedDownloadService;
|
|
|
|
_diskProvider = diskProvider;
|
|
|
|
_diskProvider = diskProvider;
|
|
|
|
|
|
|
|
_completedDownloadService = completedDownloadService;
|
|
|
|
_logger = logger;
|
|
|
|
_logger = logger;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -46,14 +50,14 @@ namespace NzbDrone.Core.MediaFiles
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_logger.Debug("External directory scan request for known download {0}. [{1}]", message.DownloadClientId, message.Path);
|
|
|
|
_logger.Debug("External directory scan request for known download {0}. [{1}]", message.DownloadClientId, message.Path);
|
|
|
|
|
|
|
|
|
|
|
|
return _downloadedMovieImportService.ProcessPath(message.Path, message.ImportMode, trackedDownload.RemoteMovie.Movie, trackedDownload.DownloadItem);
|
|
|
|
var importResults = _downloadedMovieImportService.ProcessPath(message.Path, message.ImportMode, trackedDownload.RemoteMovie.Movie, trackedDownload.DownloadItem);
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_logger.Warn("External directory scan request for unknown download {0}, attempting normal import. [{1}]", message.DownloadClientId, message.Path);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return _downloadedMovieImportService.ProcessPath(message.Path, message.ImportMode);
|
|
|
|
_completedDownloadService.VerifyImport(trackedDownload, importResults);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return importResults;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_logger.Warn("External directory scan request for unknown download {0}, attempting normal import. [{1}]", message.DownloadClientId, message.Path);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return _downloadedMovieImportService.ProcessPath(message.Path, message.ImportMode);
|
|
|
|
return _downloadedMovieImportService.ProcessPath(message.Path, message.ImportMode);
|
|
|
|