|
|
@ -1,6 +1,7 @@
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Linq;
|
|
|
|
using NLog;
|
|
|
|
using NLog;
|
|
|
|
|
|
|
|
using NzbDrone.Common;
|
|
|
|
using NzbDrone.Core.Configuration;
|
|
|
|
using NzbDrone.Core.Configuration;
|
|
|
|
using NzbDrone.Core.History;
|
|
|
|
using NzbDrone.Core.History;
|
|
|
|
using NzbDrone.Core.Messaging.Commands;
|
|
|
|
using NzbDrone.Core.Messaging.Commands;
|
|
|
@ -72,8 +73,7 @@ namespace NzbDrone.Core.Download
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (failedHistory.Any(h => h.Data.ContainsKey(DOWNLOAD_CLIENT_ID) &&
|
|
|
|
if (failedHistory.Any(h => failedLocal.Id.Equals(h.Data.GetValueOrDefault(DOWNLOAD_CLIENT_ID))))
|
|
|
|
h.Data[DOWNLOAD_CLIENT_ID].Equals(failedLocal.Id)))
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_logger.Trace("Already added to history as failed");
|
|
|
|
_logger.Trace("Already added to history as failed");
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
@ -118,8 +118,7 @@ namespace NzbDrone.Core.Download
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (failedHistory.Any(h => h.Data.ContainsKey(DOWNLOAD_CLIENT_ID) &&
|
|
|
|
if (failedHistory.Any(h => failedLocal.Id.Equals(h.Data.GetValueOrDefault(DOWNLOAD_CLIENT_ID))))
|
|
|
|
h.Data[DOWNLOAD_CLIENT_ID].Equals(failedLocal.Id)))
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_logger.Trace("Already added to history as failed");
|
|
|
|
_logger.Trace("Already added to history as failed");
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
@ -137,8 +136,7 @@ namespace NzbDrone.Core.Download
|
|
|
|
|
|
|
|
|
|
|
|
private List<History.History> GetHistoryItems(List<History.History> grabbedHistory, string downloadClientId)
|
|
|
|
private List<History.History> GetHistoryItems(List<History.History> grabbedHistory, string downloadClientId)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return grabbedHistory.Where(h => h.Data.ContainsKey(DOWNLOAD_CLIENT_ID) &&
|
|
|
|
return grabbedHistory.Where(h => downloadClientId.Equals(h.Data.GetValueOrDefault(DOWNLOAD_CLIENT_ID)))
|
|
|
|
h.Data[DOWNLOAD_CLIENT_ID].Equals(downloadClientId))
|
|
|
|
|
|
|
|
.ToList();
|
|
|
|
.ToList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -148,17 +146,14 @@ namespace NzbDrone.Core.Download
|
|
|
|
string downloadClient;
|
|
|
|
string downloadClient;
|
|
|
|
string downloadClientId;
|
|
|
|
string downloadClientId;
|
|
|
|
|
|
|
|
|
|
|
|
historyItem.Data.TryGetValue(DOWNLOAD_CLIENT, out downloadClient);
|
|
|
|
|
|
|
|
historyItem.Data.TryGetValue(DOWNLOAD_CLIENT_ID, out downloadClientId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_eventAggregator.PublishEvent(new DownloadFailedEvent
|
|
|
|
_eventAggregator.PublishEvent(new DownloadFailedEvent
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SeriesId = historyItem.SeriesId,
|
|
|
|
SeriesId = historyItem.SeriesId,
|
|
|
|
EpisodeIds = historyItems.Select(h => h.EpisodeId).ToList(),
|
|
|
|
EpisodeIds = historyItems.Select(h => h.EpisodeId).ToList(),
|
|
|
|
Quality = historyItem.Quality,
|
|
|
|
Quality = historyItem.Quality,
|
|
|
|
SourceTitle = historyItem.SourceTitle,
|
|
|
|
SourceTitle = historyItem.SourceTitle,
|
|
|
|
DownloadClient = downloadClient,
|
|
|
|
DownloadClient = historyItem.Data.GetValueOrDefault(DOWNLOAD_CLIENT),
|
|
|
|
DownloadClientId = downloadClientId,
|
|
|
|
DownloadClientId = historyItem.Data.GetValueOrDefault(DOWNLOAD_CLIENT_ID),
|
|
|
|
Message = message
|
|
|
|
Message = message
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|