Fixed: Manual Import Fails on failed Import Items

pull/1807/head
Qstick 4 years ago
parent 72658dd2d5
commit 7566f68fea

@ -42,6 +42,7 @@ namespace NzbDrone.Core.MediaFiles.TrackImport.Manual
private readonly IImportApprovedTracks _importApprovedTracks; private readonly IImportApprovedTracks _importApprovedTracks;
private readonly ITrackedDownloadService _trackedDownloadService; private readonly ITrackedDownloadService _trackedDownloadService;
private readonly IDownloadedTracksImportService _downloadedTracksImportService; private readonly IDownloadedTracksImportService _downloadedTracksImportService;
private readonly IProvideImportItemService _provideImportItemService;
private readonly IEventAggregator _eventAggregator; private readonly IEventAggregator _eventAggregator;
private readonly Logger _logger; private readonly Logger _logger;
@ -58,6 +59,7 @@ namespace NzbDrone.Core.MediaFiles.TrackImport.Manual
IImportApprovedTracks importApprovedTracks, IImportApprovedTracks importApprovedTracks,
ITrackedDownloadService trackedDownloadService, ITrackedDownloadService trackedDownloadService,
IDownloadedTracksImportService downloadedTracksImportService, IDownloadedTracksImportService downloadedTracksImportService,
IProvideImportItemService provideImportItemService,
IEventAggregator eventAggregator, IEventAggregator eventAggregator,
Logger logger) Logger logger)
{ {
@ -74,6 +76,7 @@ namespace NzbDrone.Core.MediaFiles.TrackImport.Manual
_importApprovedTracks = importApprovedTracks; _importApprovedTracks = importApprovedTracks;
_trackedDownloadService = trackedDownloadService; _trackedDownloadService = trackedDownloadService;
_downloadedTracksImportService = downloadedTracksImportService; _downloadedTracksImportService = downloadedTracksImportService;
_provideImportItemService = provideImportItemService;
_eventAggregator = eventAggregator; _eventAggregator = eventAggregator;
_logger = logger; _logger = logger;
} }
@ -89,6 +92,11 @@ namespace NzbDrone.Core.MediaFiles.TrackImport.Manual
return new List<ManualImportItem>(); return new List<ManualImportItem>();
} }
if (trackedDownload.ImportItem == null)
{
trackedDownload.ImportItem = _provideImportItemService.ProvideImportItem(trackedDownload.DownloadItem, trackedDownload.ImportItem);
}
path = trackedDownload.ImportItem.OutputPath.FullPath; path = trackedDownload.ImportItem.OutputPath.FullPath;
} }

Loading…
Cancel
Save