@ -96,6 +96,8 @@ namespace NzbDrone.Core.Download
if ( series = = null )
{
trackedDownload . Warn ( "Series title mismatch; automatic import is not possible. Check the download troubleshooting entry on the wiki for common causes." ) ;
SendManualInteractionRequiredNotification ( trackedDownload ) ;
return ;
}
@ -106,16 +108,7 @@ namespace NzbDrone.Core.Download
if ( seriesMatchType = = SeriesMatchType . Id & & releaseSource ! = ReleaseSourceType . InteractiveSearch )
{
trackedDownload . Warn ( "Found matching series via grab history, but release was matched to series by ID. Automatic import is not possible. See the FAQ for details." ) ;
if ( ! trackedDownload . HasNotifiedManualInteractionRequired )
{
trackedDownload . HasNotifiedManualInteractionRequired = true ;
var releaseInfo = new GrabbedReleaseInfo ( grabbedHistories ) ;
var manualInteractionEvent = new ManualInteractionRequiredEvent ( trackedDownload , releaseInfo ) ;
_eventAggregator . PublishEvent ( manualInteractionEvent ) ;
}
SendManualInteractionRequiredNotification ( trackedDownload ) ;
return ;
}
@ -136,6 +129,8 @@ namespace NzbDrone.Core.Download
if ( trackedDownload . RemoteEpisode = = null )
{
trackedDownload . Warn ( "Unable to parse download, automatic import is not possible." ) ;
SendManualInteractionRequiredNotification ( trackedDownload ) ;
return ;
}
@ -192,6 +187,7 @@ namespace NzbDrone.Core.Download
if ( statusMessages . Any ( ) )
{
trackedDownload . Warn ( statusMessages . ToArray ( ) ) ;
SendManualInteractionRequiredNotification ( trackedDownload ) ;
}
}
@ -258,6 +254,21 @@ namespace NzbDrone.Core.Download
return false ;
}
private void SendManualInteractionRequiredNotification ( TrackedDownload trackedDownload )
{
if ( ! trackedDownload . HasNotifiedManualInteractionRequired )
{
var grabbedHistories = _historyService . FindByDownloadId ( trackedDownload . DownloadItem . DownloadId ) . Where ( h = > h . EventType = = EpisodeHistoryEventType . Grabbed ) . ToList ( ) ;
trackedDownload . HasNotifiedManualInteractionRequired = true ;
var releaseInfo = grabbedHistories . Count > 0 ? new GrabbedReleaseInfo ( grabbedHistories ) : null ;
var manualInteractionEvent = new ManualInteractionRequiredEvent ( trackedDownload , releaseInfo ) ;
_eventAggregator . PublishEvent ( manualInteractionEvent ) ;
}
}
private void SetImportItem ( TrackedDownload trackedDownload )
{
trackedDownload . ImportItem = _provideImportItemService . ProvideImportItem ( trackedDownload . DownloadItem , trackedDownload . ImportItem ) ;