Skip to content

Commit

Permalink
New: Add Release group to history for all events
Browse files Browse the repository at this point in the history
  • Loading branch information
markus101 committed Jan 23, 2022
1 parent ccc378f commit 1ee4021
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/NzbDrone.Core/Download/DownloadIgnoredEvent.cs
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -14,6 +15,7 @@ public class DownloadIgnoredEvent : IEvent
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; }
}
}
1 change: 1 addition & 0 deletions src/NzbDrone.Core/Download/IgnoredDownloadService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public bool IgnoreDownload(TrackedDownload trackedDownload)
SourceTitle = trackedDownload.DownloadItem.Title,
DownloadClientInfo = trackedDownload.DownloadItem.DownloadClientInfo,
DownloadId = trackedDownload.DownloadItem.DownloadId,
TrackedDownload = trackedDownload,
Message = "Manually ignored"
};

Expand Down
5 changes: 5 additions & 0 deletions src/NzbDrone.Core/History/HistoryService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ public void Handle(EpisodeImportedEvent message)
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);
}
Expand All @@ -244,6 +245,7 @@ public void Handle(DownloadFailedEvent message)
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);
}
Expand Down Expand Up @@ -279,6 +281,7 @@ public void Handle(EpisodeFileDeletedEvent message)

history.Data.Add("Reason", message.Reason.ToString());
history.Data.Add("PreferredWordScore", episodeFilePreferredWordScore.ToString());
history.Data.Add("ReleaseGroup", message.EpisodeFile.ReleaseGroup);

_historyRepository.Insert(history);
}
Expand Down Expand Up @@ -308,6 +311,7 @@ public void Handle(EpisodeFileRenamedEvent message)
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);
}
Expand All @@ -334,6 +338,7 @@ public void Handle(DownloadIgnoredEvent message)
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);
}
Expand Down

0 comments on commit 1ee4021

Please sign in to comment.