From 78dd7c33ee8805f83ff32e14f4ec10fa92f524a4 Mon Sep 17 00:00:00 2001 From: Benjamin Harder Date: Mon, 5 Aug 2024 21:17:51 +0200 Subject: [PATCH] Correcting download status when fetching metadata --- .../QBittorrentTests/QBittorrentFixture.cs | 23 ++++++++++++++++++- .../Clients/QBittorrent/QBittorrent.cs | 2 +- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/QBittorrentTests/QBittorrentFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/QBittorrentTests/QBittorrentFixture.cs index 4b126835b..bf7ee60ba 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadClientTests/QBittorrentTests/QBittorrentFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadClientTests/QBittorrentTests/QBittorrentFixture.cs @@ -229,7 +229,6 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.QBittorrentTests [TestCase("queuedDL")] [TestCase("checkingDL")] [TestCase("checkingUP")] - [TestCase("metaDL")] [TestCase("checkingResumeData")] public void queued_item_should_have_required_properties(string state) { @@ -251,6 +250,28 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.QBittorrentTests item.RemainingTime.Should().NotHaveValue(); } + [TestCase("metaDL")] + [TestCase("forcedMetaDL")] + public void metaDL_item_should_have_required_properties(string state) + { + var torrent = new QBittorrentTorrent + { + Hash = "HASH", + Name = _title, + Size = 1000, + Progress = 0.0, + Eta = 8640000, + State = state, + Label = "", + SavePath = "" + }; + GivenTorrents(new List { torrent }); + + var item = Subject.GetItems().Single(); + VerifyDownloading(item); + item.RemainingTime.Should().NotHaveValue(); + } + [Test] public void downloading_item_should_have_required_properties() { diff --git a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs index 8bec2d2fd..6580f2f80 100644 --- a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs +++ b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs @@ -287,7 +287,7 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent case "forcedMetaDL": // torrent metadata is being forcibly downloaded if (config.DhtEnabled) { - item.Status = DownloadItemStatus.Queued; + item.Status = DownloadItemStatus.Downloading; item.Message = _localizationService.GetLocalizedString("DownloadClientQbittorrentTorrentStateMetadata"); } else