1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2025-02-25 15:22:42 +00:00

Fixed: Stop downloads requiring manual import from being stuck as Downloaded

This commit is contained in:
ta264 2022-03-31 21:07:40 +01:00
parent 0f87cb72e5
commit b9e780d41c
2 changed files with 11 additions and 0 deletions

View file

@ -82,6 +82,11 @@ private void InitialImportedDownloadHistory(IDbConnection conn, IDbTransaction t
downloadHistoryData.Add("downloadClient", data["downloadClient"]); downloadHistoryData.Add("downloadClient", data["downloadClient"]);
} }
if (data.ContainsKey("statusMessages"))
{
downloadHistoryData.Add("statusMessages", data["statusMessages"]);
}
using (var updateCmd = conn.CreateCommand()) using (var updateCmd = conn.CreateCommand())
{ {
updateCmd.Transaction = tran; updateCmd.Transaction = tran;

View file

@ -138,6 +138,12 @@ public TrackedDownload TrackDownload(DownloadClientDefinition downloadClient, Do
{ {
var state = GetStateFromHistory(downloadHistory.EventType); var state = GetStateFromHistory(downloadHistory.EventType);
trackedDownload.State = state; trackedDownload.State = state;
if (downloadHistory.EventType == DownloadHistoryEventType.DownloadImportIncomplete)
{
var messages = Json.Deserialize<List<TrackedDownloadStatusMessage>>(downloadHistory.Data["statusMessages"]).ToArray();
trackedDownload.Warn(messages);
}
} }
if (historyItems.Any()) if (historyItems.Any())