Fixed: Inherit indexer, size and release group for marked as failed history

(cherry picked from commit e08c9d5501e65aabce3456b2dd7571867508d88f)
This commit is contained in:
Bogdan 2025-03-11 18:09:19 +02:00
commit a86bd8e862
2 changed files with 7 additions and 1 deletions

View file

@ -10,6 +10,9 @@ namespace NzbDrone.Core.History
{
public const string DOWNLOAD_CLIENT = "downloadClient";
public const string RELEASE_SOURCE = "releaseSource";
public const string RELEASE_GROUP = "releaseGroup";
public const string SIZE = "size";
public const string INDEXER = "indexer";
public EntityHistory()
{

View file

@ -267,7 +267,9 @@ namespace NzbDrone.Core.History
history.Data.Add("DownloadClient", message.DownloadClient);
history.Data.Add("Message", message.Message);
history.Data.Add("Size", message.TrackedDownload?.DownloadItem.TotalSize.ToString());
history.Data.Add("ReleaseGroup", message.TrackedDownload?.RemoteAlbum?.ParsedAlbumInfo?.ReleaseGroup ?? message.Data.GetValueOrDefault(EntityHistory.RELEASE_GROUP));
history.Data.Add("Size", message.TrackedDownload?.DownloadItem.TotalSize.ToString() ?? message.Data.GetValueOrDefault(EntityHistory.SIZE));
history.Data.Add("Indexer", message.TrackedDownload?.RemoteAlbum?.Release?.Indexer ?? message.Data.GetValueOrDefault(EntityHistory.INDEXER));
_historyRepository.Insert(history);
}
@ -417,6 +419,7 @@ namespace NzbDrone.Core.History
history.Data.Add("Message", message.Message);
history.Data.Add("ReleaseGroup", message.TrackedDownload?.RemoteAlbum?.ParsedAlbumInfo?.ReleaseGroup);
history.Data.Add("Size", message.TrackedDownload?.DownloadItem.TotalSize.ToString());
history.Data.Add("Indexer", message.TrackedDownload?.RemoteAlbum?.Release?.Indexer);
historyToAdd.Add(history);
}