Skip to content

Commit

Permalink
New: Handle missingFiles status from qBit
Browse files Browse the repository at this point in the history
(cherry picked from commit 9a2cee3)
  • Loading branch information
Qstick committed Oct 14, 2020
1 parent c6d49c6 commit 0581ff4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Expand Up @@ -258,6 +258,27 @@ public void stalledDL_item_should_have_required_properties()
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<QBittorrentTorrent> { torrent });

var item = Subject.GetItems().Single();
VerifyWarning(item);
item.RemainingTime.Should().NotHaveValue();
}

[Test]
public void Download_should_return_unique_id()
{
Expand Down
5 changes: 5 additions & 0 deletions src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs
Expand Up @@ -182,6 +182,11 @@ public override IEnumerable<DownloadClientItem> GetItems()
item.Message = "The download is stalled with no connections";
break;

case "missingFiles": // torrent is being downloaded, but no connection were made
item.Status = DownloadItemStatus.Warning;
item.Message = "The download is missing files";
break;

case "metaDL": // torrent magnet is being downloaded
if (config.DhtEnabled)
{
Expand Down

0 comments on commit 0581ff4

Please sign in to comment.