mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 12:02:35 +02:00
TrackedDownload cache, queue etc now use DownloadId instead of TrackedId so it can be found purely by the id provided by the download client.
This commit is contained in:
parent
8b8b60f8b8
commit
d67811b50a
@ -102,7 +102,7 @@ private TrackedDownload GetTrackedDownload(int queueId)
|
||||
throw new NotFoundException();
|
||||
}
|
||||
|
||||
var trackedDownload = _trackedDownloadService.Find(queueItem.TrackingId);
|
||||
var trackedDownload = _trackedDownloadService.Find(queueItem.DownloadId);
|
||||
|
||||
if (trackedDownload == null)
|
||||
{
|
||||
|
@ -21,6 +21,6 @@ public class QueueResource : RestResource
|
||||
public String Status { get; set; }
|
||||
public String TrackedDownloadStatus { get; set; }
|
||||
public List<TrackedDownloadStatusMessage> StatusMessages { get; set; }
|
||||
public String TrackingId { get; set; }
|
||||
public String DownloadId { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,6 @@ namespace NzbDrone.Core.Download.TrackedDownloads
|
||||
{
|
||||
public class TrackedDownload
|
||||
{
|
||||
public String TrackingId { get; set; }
|
||||
public Int32 DownloadClient { get; set; }
|
||||
public DownloadClientItem DownloadItem { get; set; }
|
||||
public TrackedDownloadStage State { get; set; }
|
||||
|
@ -32,9 +32,9 @@ public TrackedDownloadService(IParsingService parsingService,
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public TrackedDownload Find(string trackingId)
|
||||
public TrackedDownload Find(string downloadId)
|
||||
{
|
||||
return _cache.Find(trackingId);
|
||||
return _cache.Find(downloadId);
|
||||
}
|
||||
|
||||
public TrackedDownload TrackDownload(DownloadClientDefinition downloadClient, DownloadClientItem downloadItem)
|
||||
@ -49,7 +49,6 @@ public TrackedDownload TrackDownload(DownloadClientDefinition downloadClient, Do
|
||||
|
||||
var trackedDownload = new TrackedDownload
|
||||
{
|
||||
TrackingId = downloadClient.Id + "-" + downloadItem.DownloadId,
|
||||
DownloadClient = downloadClient.Id,
|
||||
DownloadItem = downloadItem,
|
||||
Protocol = downloadClient.Protocol
|
||||
@ -89,7 +88,7 @@ public TrackedDownload TrackDownload(DownloadClientDefinition downloadClient, Do
|
||||
trackedDownload.State = GetStateFromHistory(historyItem.EventType);
|
||||
}
|
||||
|
||||
_cache.Set(trackedDownload.TrackingId, trackedDownload);
|
||||
_cache.Set(trackedDownload.DownloadItem.DownloadId, trackedDownload);
|
||||
|
||||
return trackedDownload;
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ public class Queue : ModelBase
|
||||
public String Status { get; set; }
|
||||
public String TrackedDownloadStatus { get; set; }
|
||||
public List<TrackedDownloadStatusMessage> StatusMessages { get; set; }
|
||||
public String TrackingId { get; set; }
|
||||
public String DownloadId { get; set; }
|
||||
public RemoteEpisode RemoteEpisode { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ private IEnumerable<Queue> MapQueue(TrackedDownload trackedDownload)
|
||||
TrackedDownloadStatus = trackedDownload.Status.ToString(),
|
||||
StatusMessages = trackedDownload.StatusMessages.ToList(),
|
||||
RemoteEpisode = trackedDownload.RemoteEpisode,
|
||||
TrackingId = trackedDownload.TrackingId
|
||||
DownloadId = trackedDownload.DownloadItem.DownloadId
|
||||
};
|
||||
|
||||
if (queue.Timeleft.HasValue)
|
||||
|
Loading…
Reference in New Issue
Block a user