TrackedDownload cache, queue etc now use DownloadId instead of TrackedId so it can be found purely by the id provided by the download client.

pull/4/head
Taloth Saldono 10 years ago
parent 8b8b60f8b8
commit d67811b50a

@ -102,7 +102,7 @@ namespace NzbDrone.Api.Queue
throw new NotFoundException();
}
var trackedDownload = _trackedDownloadService.Find(queueItem.TrackingId);
var trackedDownload = _trackedDownloadService.Find(queueItem.DownloadId);
if (trackedDownload == null)
{

@ -21,6 +21,6 @@ namespace NzbDrone.Api.Queue
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 @@ namespace NzbDrone.Core.Download.TrackedDownloads
_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 @@ namespace NzbDrone.Core.Download.TrackedDownloads
var trackedDownload = new TrackedDownload
{
TrackingId = downloadClient.Id + "-" + downloadItem.DownloadId,
DownloadClient = downloadClient.Id,
DownloadItem = downloadItem,
Protocol = downloadClient.Protocol
@ -89,7 +88,7 @@ namespace NzbDrone.Core.Download.TrackedDownloads
trackedDownload.State = GetStateFromHistory(historyItem.EventType);
}
_cache.Set(trackedDownload.TrackingId, trackedDownload);
_cache.Set(trackedDownload.DownloadItem.DownloadId, trackedDownload);
return trackedDownload;
}

@ -21,7 +21,7 @@ namespace NzbDrone.Core.Queue
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 @@ namespace NzbDrone.Core.Queue
TrackedDownloadStatus = trackedDownload.Status.ToString(),
StatusMessages = trackedDownload.StatusMessages.ToList(),
RemoteEpisode = trackedDownload.RemoteEpisode,
TrackingId = trackedDownload.TrackingId
DownloadId = trackedDownload.DownloadItem.DownloadId
};
if (queue.Timeleft.HasValue)

Loading…
Cancel
Save