mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-20 01:42:35 +01:00
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 @@ public void DownloadReport(RemoteEpisode remoteEpisode)
|
||||
|
||||
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 @@ private void CheckHistory(List<History.History> grabbedHistory, List<History.His
|
||||
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 @@ public void Handle(EpisodeGrabbedEvent message)
|
||||
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
Block a user