mirror of https://github.com/lidarr/Lidarr
Moving and Removing of downloads in usenet clients
Fixed: Moving items triggered via post-processing scripts Fixed: Removing failed downloads fromusenet clients
This commit is contained in:
parent
f8b8fcfb8d
commit
f36d5dc881
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using FluentAssertions;
|
||||
|
@ -107,6 +107,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.NzbVortexTests
|
|||
var result = Subject.GetItems().Single();
|
||||
|
||||
VerifyQueued(result);
|
||||
|
||||
result.CanBeRemoved.Should().BeTrue();
|
||||
result.CanMoveFiles.Should().BeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -118,6 +121,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.NzbVortexTests
|
|||
var result = Subject.GetItems().Single();
|
||||
|
||||
VerifyPaused(result);
|
||||
|
||||
result.CanBeRemoved.Should().BeTrue();
|
||||
result.CanMoveFiles.Should().BeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -129,6 +135,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.NzbVortexTests
|
|||
var result = Subject.GetItems().Single();
|
||||
|
||||
VerifyDownloading(result);
|
||||
|
||||
result.CanBeRemoved.Should().BeTrue();
|
||||
result.CanMoveFiles.Should().BeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -152,6 +161,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.NzbVortexTests
|
|||
var result = Subject.GetItems().Single();
|
||||
|
||||
VerifyFailed(result);
|
||||
|
||||
result.CanBeRemoved.Should().BeTrue();
|
||||
result.CanMoveFiles.Should().BeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using FluentAssertions;
|
||||
|
@ -167,6 +167,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.NzbgetTests
|
|||
var result = Subject.GetItems().Single();
|
||||
|
||||
VerifyQueued(result);
|
||||
|
||||
result.CanBeRemoved.Should().BeTrue();
|
||||
result.CanMoveFiles.Should().BeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -180,6 +183,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.NzbgetTests
|
|||
var result = Subject.GetItems().Single();
|
||||
|
||||
VerifyPaused(result);
|
||||
|
||||
result.CanBeRemoved.Should().BeTrue();
|
||||
result.CanMoveFiles.Should().BeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -193,6 +199,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.NzbgetTests
|
|||
var result = Subject.GetItems().Single();
|
||||
|
||||
VerifyDownloading(result);
|
||||
|
||||
result.CanBeRemoved.Should().BeTrue();
|
||||
result.CanMoveFiles.Should().BeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using FizzWare.NBuilder;
|
||||
|
@ -191,7 +191,10 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
|
|||
var result = Subject.GetItems().Single();
|
||||
|
||||
VerifyQueued(result);
|
||||
|
||||
result.RemainingTime.Should().NotBe(TimeSpan.Zero);
|
||||
result.CanBeRemoved.Should().BeTrue();
|
||||
result.CanMoveFiles.Should().BeTrue();
|
||||
}
|
||||
|
||||
[TestCase(SabnzbdDownloadStatus.Paused)]
|
||||
|
@ -205,6 +208,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
|
|||
var result = Subject.GetItems().Single();
|
||||
|
||||
VerifyPaused(result);
|
||||
|
||||
result.CanBeRemoved.Should().BeTrue();
|
||||
result.CanMoveFiles.Should().BeTrue();
|
||||
}
|
||||
|
||||
[TestCase(SabnzbdDownloadStatus.Checking)]
|
||||
|
@ -227,7 +233,10 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
|
|||
var result = Subject.GetItems().Single();
|
||||
|
||||
VerifyDownloading(result);
|
||||
|
||||
result.RemainingTime.Should().NotBe(TimeSpan.Zero);
|
||||
result.CanBeRemoved.Should().BeTrue();
|
||||
result.CanMoveFiles.Should().BeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -255,6 +264,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
|
|||
var result = Subject.GetItems().Single();
|
||||
|
||||
VerifyFailed(result);
|
||||
|
||||
result.CanBeRemoved.Should().BeTrue();
|
||||
result.CanMoveFiles.Should().BeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
|
|
@ -78,6 +78,8 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd
|
|||
queueItem.TotalSize = (long)(sabQueueItem.Size * 1024 * 1024);
|
||||
queueItem.RemainingSize = (long)(sabQueueItem.Sizeleft * 1024 * 1024);
|
||||
queueItem.RemainingTime = sabQueueItem.Timeleft;
|
||||
queueItem.CanBeRemoved = true;
|
||||
queueItem.CanMoveFiles = true;
|
||||
|
||||
if (sabQueue.Paused || sabQueueItem.Status == SabnzbdDownloadStatus.Paused)
|
||||
{
|
||||
|
@ -142,7 +144,10 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd
|
|||
RemainingSize = 0,
|
||||
RemainingTime = TimeSpan.Zero,
|
||||
|
||||
Message = sabHistoryItem.FailMessage
|
||||
Message = sabHistoryItem.FailMessage,
|
||||
|
||||
CanBeRemoved = true,
|
||||
CanMoveFiles = true
|
||||
};
|
||||
|
||||
if (sabHistoryItem.Status == SabnzbdDownloadStatus.Failed)
|
||||
|
@ -160,8 +165,6 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd
|
|||
else if (sabHistoryItem.Status == SabnzbdDownloadStatus.Completed)
|
||||
{
|
||||
historyItem.Status = DownloadItemStatus.Completed;
|
||||
historyItem.CanBeRemoved = true;
|
||||
historyItem.CanMoveFiles = true;
|
||||
}
|
||||
else // Verifying/Moving etc
|
||||
{
|
||||
|
@ -185,6 +188,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
historyItems.Add(historyItem);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue