Fixed: (Gazelle) Add `usetoken` only if use FL token is enabled

pull/3475/head
Bogdan 2 years ago committed by Qstick
parent 2cabc3eb0d
commit fbb05dcec9

@ -56,7 +56,7 @@ namespace NzbDrone.Core.Test.IndexerTests.GazelleTests
releaseInfo.Title.Should().Be("Shania Twain - Shania Twain (1993) [FLAC 24bit Lossless] [WEB]");
releaseInfo.DownloadProtocol.Should().Be(DownloadProtocol.Torrent);
releaseInfo.DownloadUrl.Should()
.Be("http://someurl.ch/torrents.php?action=download&id=1541452&authkey=redacted&torrent_pass=redacted&usetoken=0");
.Be("http://someurl.ch/torrents.php?action=download&id=1541452&authkey=redacted&torrent_pass=redacted");
releaseInfo.InfoUrl.Should().Be("http://someurl.ch/torrents.php?id=106951&torrentid=1541452");
releaseInfo.CommentUrl.Should().Be(null);
releaseInfo.Indexer.Should().Be(Subject.Definition.Name);

@ -99,8 +99,13 @@ namespace NzbDrone.Core.Indexers.Gazelle
.AddQueryParam("action", "download")
.AddQueryParam("id", torrentId)
.AddQueryParam("authkey", _settings.AuthKey)
.AddQueryParam("torrent_pass", _settings.PassKey)
.AddQueryParam("usetoken", _settings.UseFreeleechToken ? 1 : 0);
.AddQueryParam("torrent_pass", _settings.PassKey);
// Orpheus fails to download if usetoken=0 so we need to only add if we will use one
if (_settings.UseFreeleechToken)
{
url = url.AddQueryParam("usetoken", "1");
}
return url.FullUri;
}

Loading…
Cancel
Save