diff --git a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabCommunicationProxy.cs b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabCommunicationProxy.cs index ebdcca7ed..a372185eb 100644 --- a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabCommunicationProxy.cs +++ b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabCommunicationProxy.cs @@ -1,6 +1,5 @@ using System; using System.IO; -using Newtonsoft.Json; using NLog; using NzbDrone.Common.Serializer; using NzbDrone.Core.Configuration; diff --git a/src/NzbDrone.Core/Download/DownloadService.cs b/src/NzbDrone.Core/Download/DownloadService.cs index dcb9742a9..15acf13b2 100644 --- a/src/NzbDrone.Core/Download/DownloadService.cs +++ b/src/NzbDrone.Core/Download/DownloadService.cs @@ -44,10 +44,10 @@ namespace NzbDrone.Core.Download var downloadClientId = downloadClient.DownloadNzb(remoteEpisode); var episodeGrabbedEvent = new EpisodeGrabbedEvent(remoteEpisode); + episodeGrabbedEvent.DownloadClient = downloadClient.GetType().Name; if (!String.IsNullOrWhiteSpace(downloadClientId)) { - episodeGrabbedEvent.DownloadClient = downloadClient.GetType().Name; episodeGrabbedEvent.DownloadClientId = downloadClientId; } diff --git a/src/NzbDrone.Core/Download/FailedDownloadService.cs b/src/NzbDrone.Core/Download/FailedDownloadService.cs index 4671ec150..d7334c990 100644 --- a/src/NzbDrone.Core/Download/FailedDownloadService.cs +++ b/src/NzbDrone.Core/Download/FailedDownloadService.cs @@ -132,14 +132,20 @@ namespace NzbDrone.Core.Download private void PublishDownloadFailedEvent(List historyItems, string message) { var historyItem = historyItems.First(); + string downloadClient; + string downloadClientId; + + historyItem.Data.TryGetValue(DOWNLOAD_CLIENT, out downloadClient); + historyItem.Data.TryGetValue(DOWNLOAD_CLIENT_ID, out downloadClientId); + _eventAggregator.PublishEvent(new DownloadFailedEvent { SeriesId = historyItem.SeriesId, EpisodeIds = historyItems.Select(h => h.EpisodeId).ToList(), Quality = historyItem.Quality, SourceTitle = historyItem.SourceTitle, - DownloadClient = historyItem.Data[DOWNLOAD_CLIENT], - DownloadClientId = historyItem.Data[DOWNLOAD_CLIENT_ID], + DownloadClient = downloadClient, + DownloadClientId = downloadClientId, Message = message }); } diff --git a/src/NzbDrone.Core/History/HistoryService.cs b/src/NzbDrone.Core/History/HistoryService.cs index 636d092d0..4c8758618 100644 --- a/src/NzbDrone.Core/History/HistoryService.cs +++ b/src/NzbDrone.Core/History/HistoryService.cs @@ -103,10 +103,10 @@ namespace NzbDrone.Core.History history.Data.Add("NzbInfoUrl", message.Episode.Release.InfoUrl); history.Data.Add("ReleaseGroup", message.Episode.ParsedEpisodeInfo.ReleaseGroup); history.Data.Add("Age", message.Episode.Release.Age.ToString()); + history.Data.Add("DownloadClient", message.DownloadClient); if (!String.IsNullOrWhiteSpace(message.DownloadClientId)) { - history.Data.Add("DownloadClient", message.DownloadClient); history.Data.Add("DownloadClientId", message.DownloadClientId); }