private List <TrackedDownload> ProcessClientItems(IDownloadClient downloadClient, DownloadClientItem downloadItem) { var trackedDownloads = new List <TrackedDownload>(); try { var trackedDownload = _trackedDownloadService.TrackDownload((DownloadClientDefinition)downloadClient.Definition, downloadItem); if (trackedDownload != null && trackedDownload.State == TrackedDownloadStage.Downloading) { _failedDownloadService.Process(trackedDownload); if (_configService.EnableCompletedDownloadHandling) { _completedDownloadService.Process(trackedDownload); } } trackedDownloads.AddIfNotNull(trackedDownload); } catch (Exception e) { _logger.Error(e, "Couldn't process tracked download {0}", downloadItem.Title); } return(trackedDownloads); }
private TrackedDownload ProcessClientItem(IDownloadClient downloadClient, DownloadClientItem downloadItem) { try { var trackedDownload = _trackedDownloadService.TrackDownload((DownloadClientDefinition)downloadClient.Definition, downloadItem); if (trackedDownload != null && trackedDownload.State == TrackedDownloadState.Downloading) { _failedDownloadService.Check(trackedDownload); _completedDownloadService.Check(trackedDownload); } return(trackedDownload); } catch (Exception e) { _logger.Error(e, "Couldn't process tracked download {0}", downloadItem.Title); } return(null); }