From 7b7da9c1b26284d911ba160f19792b552d25295b Mon Sep 17 00:00:00 2001 From: bakerboy448 <55419169+bakerboy448@users.noreply.github.com> Date: Fri, 26 Nov 2021 21:49:24 -0600 Subject: [PATCH] New: Handle missingFiles status from qBit --- .../QBittorrentTests/QBittorrentFixture.cs | 21 +++++++++++++++++++ .../Clients/QBittorrent/QBittorrent.cs | 5 +++++ 2 files changed, 26 insertions(+) diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/QBittorrentTests/QBittorrentFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/QBittorrentTests/QBittorrentFixture.cs index c94ae5c9b..b2bb94a3b 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadClientTests/QBittorrentTests/QBittorrentFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadClientTests/QBittorrentTests/QBittorrentFixture.cs @@ -285,6 +285,27 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.QBittorrentTests item.RemainingTime.Should().NotHaveValue(); } + [Test] + public void missingFiles_item_should_have_required_properties() + { + var torrent = new QBittorrentTorrent + { + Hash = "HASH", + Name = _title, + Size = 1000, + Progress = 0.7, + Eta = 8640000, + State = "missingFiles", + Label = "", + SavePath = "" + }; + GivenTorrents(new List { torrent }); + + var item = Subject.GetItems().Single(); + VerifyWarning(item); + item.RemainingTime.Should().NotHaveValue(); + } + [Test] public void single_file_torrent_outputpath_should_have_sanitised_name() { diff --git a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs index 11e60d5b5..b96b06021 100644 --- a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs +++ b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs @@ -269,6 +269,11 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent item.Message = "The download is stalled with no connections"; break; + case "missingFiles": // torrent is missing files + item.Status = DownloadItemStatus.Warning; + item.Message = "The download is missing files"; + break; + case "metaDL": // torrent magnet is being downloaded if (config.DhtEnabled) {