Fixed: Torrent Blackhole client will not track torrents by hash

pull/886/head
Mark McDowall 9 years ago
parent 20df619ddd
commit d170c9ad07

@ -196,5 +196,13 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.Blackhole
result.OutputRootFolders.Should().NotBeNull(); result.OutputRootFolders.Should().NotBeNull();
result.OutputRootFolders.First().Should().Be(_completedDownloadFolder); result.OutputRootFolders.First().Should().Be(_completedDownloadFolder);
} }
[Test]
public void should_return_null_hash()
{
var remoteEpisode = CreateRemoteEpisode();
Subject.Download(remoteEpisode).Should().BeNull();
}
} }
} }

@ -53,7 +53,7 @@ namespace NzbDrone.Core.Download.Clients.TorrentBlackhole
_logger.Debug("Torrent Download succeeded, saved to: {0}", filepath); _logger.Debug("Torrent Download succeeded, saved to: {0}", filepath);
return hash; return null;
} }
public override string Name public override string Name

@ -11,6 +11,7 @@ using NLog;
using NzbDrone.Core.Validation; using NzbDrone.Core.Validation;
using FluentValidation.Results; using FluentValidation.Results;
using NzbDrone.Core.Download.Clients.rTorrent; using NzbDrone.Core.Download.Clients.rTorrent;
using NzbDrone.Core.Exceptions;
using NzbDrone.Core.Parser.Model; using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.RemotePathMappings; using NzbDrone.Core.RemotePathMappings;
using NzbDrone.Core.ThingiProvider; using NzbDrone.Core.ThingiProvider;
@ -85,8 +86,7 @@ namespace NzbDrone.Core.Download.Clients.RTorrent
_logger.Debug("rTorrent could not add file"); _logger.Debug("rTorrent could not add file");
RemoveItem(hash, true); RemoveItem(hash, true);
throw new ReleaseDownloadException(remoteEpisode.Release, "Downloading torrent failed");
return null;
} }
} }

@ -85,11 +85,6 @@ namespace NzbDrone.Core.Download
hash = DownloadFromWebUrl(remoteEpisode, torrentUrl); hash = DownloadFromWebUrl(remoteEpisode, torrentUrl);
} }
if (hash == null)
{
throw new ReleaseDownloadException(remoteEpisode.Release, "Downloading torrent failed");
}
return hash; return hash;
} }
@ -147,9 +142,9 @@ namespace NzbDrone.Core.Download
var hash = _torrentFileInfoReader.GetHashFromTorrentFile(torrentFile); var hash = _torrentFileInfoReader.GetHashFromTorrentFile(torrentFile);
var actualHash = AddFromTorrentFile(remoteEpisode, hash, filename, torrentFile); var actualHash = AddFromTorrentFile(remoteEpisode, hash, filename, torrentFile);
if (hash != actualHash) if (actualHash.IsNotNullOrWhiteSpace() && hash != actualHash)
{ {
_logger.Warn( _logger.Debug(
"{0} did not return the expected InfoHash for '{1}', Sonarr could potentially lose track of the download in progress.", "{0} did not return the expected InfoHash for '{1}', Sonarr could potentially lose track of the download in progress.",
Definition.Implementation, remoteEpisode.Release.DownloadUrl); Definition.Implementation, remoteEpisode.Release.DownloadUrl);
} }
@ -179,9 +174,9 @@ namespace NzbDrone.Core.Download
actualHash = AddFromMagnetLink(remoteEpisode, hash, magnetUrl); actualHash = AddFromMagnetLink(remoteEpisode, hash, magnetUrl);
} }
if (hash != actualHash) if (actualHash.IsNotNullOrWhiteSpace() && hash != actualHash)
{ {
_logger.Warn( _logger.Debug(
"{0} did not return the expected InfoHash for '{1}', Sonarr could potentially lose track of the download in progress.", "{0} did not return the expected InfoHash for '{1}', Sonarr could potentially lose track of the download in progress.",
Definition.Implementation, remoteEpisode.Release.DownloadUrl); Definition.Implementation, remoteEpisode.Release.DownloadUrl);
} }

Loading…
Cancel
Save