Fixed: Manually failing a release
This commit is contained in:
parent
1ff652f6d6
commit
fcd5619041
|
@ -1,6 +1,5 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using Newtonsoft.Json;
|
||||
using NLog;
|
||||
using NzbDrone.Common.Serializer;
|
||||
using NzbDrone.Core.Configuration;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -132,14 +132,20 @@ namespace NzbDrone.Core.Download
|
|||
private void PublishDownloadFailedEvent(List<History.History> 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
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue