Storing nzo_id from SAB in history (data)

This commit is contained in:
Mark McDowall
2013-10-20 18:30:46 -07:00
parent fa2bc76102
commit 2e1b921543
8 changed files with 36 additions and 51 deletions

View File

@@ -1,4 +1,5 @@
using NLog;
using System;
using NLog;
using NzbDrone.Common.EnsureThat;
using NzbDrone.Core.Instrumentation;
using NzbDrone.Core.Messaging.Events;
@@ -40,10 +41,17 @@ namespace NzbDrone.Core.Download
return;
}
downloadClient.DownloadNzb(remoteEpisode);
var downloadClientId = downloadClient.DownloadNzb(remoteEpisode);
var episodeGrabbedEvent = new EpisodeGrabbedEvent(remoteEpisode);
if (!String.IsNullOrWhiteSpace(downloadClientId))
{
episodeGrabbedEvent.DownloadClient = downloadClient.GetType().Name;
episodeGrabbedEvent.DownloadClientId = downloadClientId;
}
_logger.ProgressInfo("Report sent to download client. {0}", downloadTitle);
_eventAggregator.PublishEvent(new EpisodeGrabbedEvent(remoteEpisode));
_eventAggregator.PublishEvent(episodeGrabbedEvent);
}
}
}