mirror of
https://github.com/Readarr/Readarr
synced 2025-12-07 17:03:16 +01:00
Fixed: Inherit indexer, size and release group for marked as failed history
(cherry picked from commit e08c9d5501e65aabce3456b2dd7571867508d88f)
This commit is contained in:
parent
70aec175ef
commit
7ba8f8baee
2 changed files with 7 additions and 1 deletions
|
|
@ -10,6 +10,9 @@ public class EntityHistory : ModelBase
|
||||||
{
|
{
|
||||||
public const string DOWNLOAD_CLIENT = "downloadClient";
|
public const string DOWNLOAD_CLIENT = "downloadClient";
|
||||||
public const string RELEASE_SOURCE = "releaseSource";
|
public const string RELEASE_SOURCE = "releaseSource";
|
||||||
|
public const string RELEASE_GROUP = "releaseGroup";
|
||||||
|
public const string SIZE = "size";
|
||||||
|
public const string INDEXER = "indexer";
|
||||||
|
|
||||||
public EntityHistory()
|
public EntityHistory()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -263,7 +263,9 @@ public void Handle(DownloadFailedEvent message)
|
||||||
history.Data.Add("DownloadClient", message.DownloadClient);
|
history.Data.Add("DownloadClient", message.DownloadClient);
|
||||||
history.Data.Add("DownloadClientName", message.TrackedDownload?.DownloadItem.DownloadClientInfo.Name);
|
history.Data.Add("DownloadClientName", message.TrackedDownload?.DownloadItem.DownloadClientInfo.Name);
|
||||||
history.Data.Add("Message", message.Message);
|
history.Data.Add("Message", message.Message);
|
||||||
history.Data.Add("Size", message.TrackedDownload?.DownloadItem.TotalSize.ToString());
|
history.Data.Add("ReleaseGroup", message.TrackedDownload?.RemoteBook?.ParsedBookInfo?.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?.RemoteBook?.Release?.Indexer ?? message.Data.GetValueOrDefault(EntityHistory.INDEXER));
|
||||||
|
|
||||||
_historyRepository.Insert(history);
|
_historyRepository.Insert(history);
|
||||||
}
|
}
|
||||||
|
|
@ -373,6 +375,7 @@ public void Handle(DownloadIgnoredEvent message)
|
||||||
history.Data.Add("Message", message.Message);
|
history.Data.Add("Message", message.Message);
|
||||||
history.Data.Add("ReleaseGroup", message.TrackedDownload?.RemoteBook?.ParsedBookInfo?.ReleaseGroup);
|
history.Data.Add("ReleaseGroup", message.TrackedDownload?.RemoteBook?.ParsedBookInfo?.ReleaseGroup);
|
||||||
history.Data.Add("Size", message.TrackedDownload?.DownloadItem.TotalSize.ToString());
|
history.Data.Add("Size", message.TrackedDownload?.DownloadItem.TotalSize.ToString());
|
||||||
|
history.Data.Add("Indexer", message.TrackedDownload?.RemoteBook?.Release?.Indexer);
|
||||||
|
|
||||||
historyToAdd.Add(history);
|
historyToAdd.Add(history);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue