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