1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-26 09:47:39 +00:00

Fixed: Manually failing a release

This commit is contained in:
Mark McDowall 2014-01-05 11:49:04 -08:00
parent 1ff652f6d6
commit fcd5619041
4 changed files with 10 additions and 5 deletions

View file

@ -1,6 +1,5 @@
using System;
using System.IO;
using Newtonsoft.Json;
using NLog;
using NzbDrone.Common.Serializer;
using NzbDrone.Core.Configuration;

View file

@ -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;
}

View file

@ -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
});
}

View file

@ -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);
}