New: Return downloading magnets from Transmission

Closes #7029
This commit is contained in:
Mark McDowall 2024-07-29 21:07:14 -07:00
parent 72db8099e0
commit bfbfcd1d0a
2 changed files with 9 additions and 8 deletions

View File

@ -49,10 +49,13 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.TransmissionTests
} }
[Test] [Test]
public void magnet_download_should_not_return_the_item() public void magnet_download_should_be_returned_as_queued()
{ {
PrepareClientToReturnMagnetItem(); PrepareClientToReturnMagnetItem();
Subject.GetItems().Count().Should().Be(0);
var item = Subject.GetItems().Single();
item.Status.Should().Be(DownloadItemStatus.Queued);
} }
[Test] [Test]

View File

@ -43,12 +43,6 @@ namespace NzbDrone.Core.Download.Clients.Transmission
foreach (var torrent in torrents) foreach (var torrent in torrents)
{ {
// If totalsize == 0 the torrent is a magnet downloading metadata
if (torrent.TotalSize == 0)
{
continue;
}
var outputPath = new OsPath(torrent.DownloadDir); var outputPath = new OsPath(torrent.DownloadDir);
if (Settings.TvDirectory.IsNotNullOrWhiteSpace()) if (Settings.TvDirectory.IsNotNullOrWhiteSpace())
@ -99,6 +93,10 @@ namespace NzbDrone.Core.Download.Clients.Transmission
item.Status = DownloadItemStatus.Warning; item.Status = DownloadItemStatus.Warning;
item.Message = torrent.ErrorString; item.Message = torrent.ErrorString;
} }
else if (torrent.TotalSize == 0)
{
item.Status = DownloadItemStatus.Queued;
}
else if (torrent.LeftUntilDone == 0 && (torrent.Status == TransmissionTorrentStatus.Stopped || else if (torrent.LeftUntilDone == 0 && (torrent.Status == TransmissionTorrentStatus.Stopped ||
torrent.Status == TransmissionTorrentStatus.Seeding || torrent.Status == TransmissionTorrentStatus.Seeding ||
torrent.Status == TransmissionTorrentStatus.SeedingWait)) torrent.Status == TransmissionTorrentStatus.SeedingWait))