Don't run DownloadCompletedEvent if DownloadItem not Completed.

This commit is contained in:
Taloth Saldono 2015-05-05 17:42:41 +02:00
parent 6abda8adef
commit 1e2ba691ed
3 changed files with 6 additions and 3 deletions

View File

@ -79,7 +79,7 @@ namespace NzbDrone.Core.Download.Clients.Nzbget
queueItem.Category = item.Category;
queueItem.DownloadClient = Definition.Name;
if (globalStatus.DownloadPaused || remainingSize == pausedSize)
if (globalStatus.DownloadPaused || remainingSize == pausedSize && remainingSize != 0)
{
queueItem.Status = DownloadItemStatus.Paused;
queueItem.RemainingSize = remainingSize;

View File

@ -90,7 +90,7 @@ namespace NzbDrone.Core.Download
return;
}
if (item.OutputPath == null)
if (item.OutputPath.IsEmpty)
{
_logger.Trace("[{0}] Doesn't have an outputPath, skipping delete data.", item.Title);
return;

View File

@ -35,7 +35,10 @@ namespace NzbDrone.Core.Download
public void Handle(DownloadCompletedEvent message)
{
if (message.TrackedDownload.DownloadItem.Removed || message.TrackedDownload.DownloadItem.IsReadOnly || !_configService.RemoveCompletedDownloads)
if (!_configService.RemoveCompletedDownloads ||
message.TrackedDownload.DownloadItem.Removed ||
message.TrackedDownload.DownloadItem.IsReadOnly ||
message.TrackedDownload.DownloadItem.Status == DownloadItemStatus.Downloading)
{
return;
}