From 1ee40215e71d81cd9fb6265f65749b12d287dcd6 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sun, 23 Jan 2022 14:16:26 -0800 Subject: [PATCH] New: Add Release group to history for all events Closes #4865 --- src/NzbDrone.Core/Download/DownloadIgnoredEvent.cs | 2 ++ src/NzbDrone.Core/Download/IgnoredDownloadService.cs | 1 + src/NzbDrone.Core/History/HistoryService.cs | 5 +++++ 3 files changed, 8 insertions(+) diff --git a/src/NzbDrone.Core/Download/DownloadIgnoredEvent.cs b/src/NzbDrone.Core/Download/DownloadIgnoredEvent.cs index e2e85348d..24f9f6ee4 100644 --- a/src/NzbDrone.Core/Download/DownloadIgnoredEvent.cs +++ b/src/NzbDrone.Core/Download/DownloadIgnoredEvent.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using NzbDrone.Common.Messaging; +using NzbDrone.Core.Download.TrackedDownloads; using NzbDrone.Core.Qualities; using NzbDrone.Core.Languages; @@ -14,6 +15,7 @@ namespace NzbDrone.Core.Download public string SourceTitle { get; set; } public DownloadClientItemClientInfo DownloadClientInfo { get; set; } public string DownloadId { get; set; } + public TrackedDownload TrackedDownload { get; set; } public string Message { get; set; } } } \ No newline at end of file diff --git a/src/NzbDrone.Core/Download/IgnoredDownloadService.cs b/src/NzbDrone.Core/Download/IgnoredDownloadService.cs index 324c67c25..b7d73c1b8 100644 --- a/src/NzbDrone.Core/Download/IgnoredDownloadService.cs +++ b/src/NzbDrone.Core/Download/IgnoredDownloadService.cs @@ -44,6 +44,7 @@ namespace NzbDrone.Core.Download SourceTitle = trackedDownload.DownloadItem.Title, DownloadClientInfo = trackedDownload.DownloadItem.DownloadClientInfo, DownloadId = trackedDownload.DownloadItem.DownloadId, + TrackedDownload = trackedDownload, Message = "Manually ignored" }; diff --git a/src/NzbDrone.Core/History/HistoryService.cs b/src/NzbDrone.Core/History/HistoryService.cs index 274256974..ed582be56 100644 --- a/src/NzbDrone.Core/History/HistoryService.cs +++ b/src/NzbDrone.Core/History/HistoryService.cs @@ -220,6 +220,7 @@ namespace NzbDrone.Core.History history.Data.Add("DownloadClient", message.DownloadClientInfo?.Type); history.Data.Add("DownloadClientName", message.DownloadClientInfo?.Name); history.Data.Add("PreferredWordScore", message.EpisodeInfo.PreferredWordScore.ToString()); + history.Data.Add("ReleaseGroup", message.EpisodeInfo.ReleaseGroup); _historyRepository.Insert(history); } @@ -244,6 +245,7 @@ namespace NzbDrone.Core.History history.Data.Add("DownloadClient", message.DownloadClient); history.Data.Add("DownloadClientName", message.TrackedDownload?.DownloadItem.DownloadClientInfo.Name); history.Data.Add("Message", message.Message); + history.Data.Add("ReleaseGroup", message.TrackedDownload?.RemoteEpisode?.ParsedEpisodeInfo?.ReleaseGroup); _historyRepository.Insert(history); } @@ -279,6 +281,7 @@ namespace NzbDrone.Core.History history.Data.Add("Reason", message.Reason.ToString()); history.Data.Add("PreferredWordScore", episodeFilePreferredWordScore.ToString()); + history.Data.Add("ReleaseGroup", message.EpisodeFile.ReleaseGroup); _historyRepository.Insert(history); } @@ -308,6 +311,7 @@ namespace NzbDrone.Core.History history.Data.Add("SourceRelativePath", sourceRelativePath); history.Data.Add("Path", path); history.Data.Add("RelativePath", relativePath); + history.Data.Add("ReleaseGroup", message.EpisodeFile.ReleaseGroup); _historyRepository.Insert(history); } @@ -334,6 +338,7 @@ namespace NzbDrone.Core.History history.Data.Add("DownloadClient", message.DownloadClientInfo.Type); history.Data.Add("DownloadClientName", message.DownloadClientInfo.Name); history.Data.Add("Message", message.Message); + history.Data.Add("ReleaseGroup", message.TrackedDownload?.RemoteEpisode?.ParsedEpisodeInfo?.ReleaseGroup); historyToAdd.Add(history); }