1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-29 19:35:25 +00:00

Fixed: issue where completed torrents wouldn't be removed after they finished seeding

This commit is contained in:
Keivan Beigi 2014-12-22 10:40:18 -08:00
parent 9fd90e6f99
commit 2193e34537

View file

@ -50,8 +50,8 @@ private void Refresh()
foreach (var downloadClient in downloadClients)
{
var clientTrackedDowmloads = ProcessClientDownloads(downloadClient);
trackedDownload.AddRange(clientTrackedDowmloads.Where(c => c.State == TrackedDownloadStage.Downloading));
var clientTrackedDownloads = ProcessClientDownloads(downloadClient);
trackedDownload.AddRange(clientTrackedDownloads.Where(c => c.State == TrackedDownloadStage.Downloading));
}
_eventAggregator.PublishEvent(new TrackedDownloadRefreshedEvent(trackedDownload));
@ -73,7 +73,8 @@ private List<TrackedDownload> ProcessClientDownloads(IDownloadClient downloadCli
foreach (var downloadItem in downloadClientHistory)
{
trackedDownloads.AddRange(ProcessClientItems(downloadClient, downloadItem));
var newItems = ProcessClientItems(downloadClient, downloadItem);
trackedDownloads.AddRange(newItems);
}
if (_configService.RemoveCompletedDownloads)
@ -87,9 +88,9 @@ private List<TrackedDownload> ProcessClientDownloads(IDownloadClient downloadCli
private void RemoveCompletedDownloads(List<TrackedDownload> trackedDownloads)
{
foreach (var trakedDownload in trackedDownloads.Where(c => !c.DownloadItem.IsReadOnly && c.State == TrackedDownloadStage.Imported))
foreach (var trackedDownload in trackedDownloads.Where(c => !c.DownloadItem.IsReadOnly && c.State == TrackedDownloadStage.Imported))
{
_eventAggregator.PublishEvent(new DownloadCompletedEvent(trakedDownload));
_eventAggregator.PublishEvent(new DownloadCompletedEvent(trackedDownload));
}
}
@ -108,8 +109,10 @@ private List<TrackedDownload> ProcessClientItems(IDownloadClient downloadClient,
_completedDownloadService.Process(trackedDownload);
}
trackedDownloads.Add(trackedDownload);
}
trackedDownloads.Add(trackedDownload);
}
catch (Exception e)
{