From 3180e648b41cb8825ad53e4799d1e4adb7a5f4d0 Mon Sep 17 00:00:00 2001 From: Devin Buhl Date: Fri, 13 Jan 2017 16:12:49 -0500 Subject: [PATCH] #236 #239 - Fixed user being needed, fixed age on torrentpotato --- .../Indexers/TorrentPotato/TorrentPotatoParser.cs | 1 + .../TorrentPotato/TorrentPotatoRequestGenerator.cs | 7 +++---- .../Indexers/TorrentPotato/TorrentPotatoResponse.cs | 1 + .../Indexers/TorrentPotato/TorrentPotatoSettings.cs | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/NzbDrone.Core/Indexers/TorrentPotato/TorrentPotatoParser.cs b/src/NzbDrone.Core/Indexers/TorrentPotato/TorrentPotatoParser.cs index 2c21e408e..fdaf7bb9d 100644 --- a/src/NzbDrone.Core/Indexers/TorrentPotato/TorrentPotatoParser.cs +++ b/src/NzbDrone.Core/Indexers/TorrentPotato/TorrentPotatoParser.cs @@ -40,6 +40,7 @@ public IList ParseResponse(IndexerResponse indexerResponse) torrentInfo.Seeders = torrent.seeders; torrentInfo.Peers = torrent.leechers + torrent.seeders; torrentInfo.Freeleech = torrent.freeleech; + torrentInfo.PublishDate = torrent.publishdate.ToUniversalTime(); results.Add(torrentInfo); } diff --git a/src/NzbDrone.Core/Indexers/TorrentPotato/TorrentPotatoRequestGenerator.cs b/src/NzbDrone.Core/Indexers/TorrentPotato/TorrentPotatoRequestGenerator.cs index f85969d1e..5222d298b 100644 --- a/src/NzbDrone.Core/Indexers/TorrentPotato/TorrentPotatoRequestGenerator.cs +++ b/src/NzbDrone.Core/Indexers/TorrentPotato/TorrentPotatoRequestGenerator.cs @@ -78,9 +78,8 @@ private IEnumerable GetPagedRequests(string mode, int? tvdbId, s .Accept(HttpAccept.Json); requestBuilder.AddQueryParam("passkey", Settings.Passkey); - requestBuilder.AddQueryParam("user", Settings.User); - // requestBuilder.AddQueryParam("imdbid", "tt0076759"); //For now just search for Star Wars. - requestBuilder.AddQueryParam("search", "the"); // there has to be movies with 'the' in the title on any indexer + requestBuilder.AddQueryParam("user", !string.IsNullOrWhiteSpace(Settings.User) ? Settings.User : ""); + requestBuilder.AddQueryParam("search", "the"); yield return new IndexerRequest(requestBuilder.Build()); } @@ -91,7 +90,7 @@ private IEnumerable GetMovieRequest(MovieSearchCriteria searchCr .Accept(HttpAccept.Json); requestBuilder.AddQueryParam("passkey", Settings.Passkey); - requestBuilder.AddQueryParam("user", Settings.User); + requestBuilder.AddQueryParam("user", !string.IsNullOrWhiteSpace(Settings.User) ? Settings.User : ""); if (searchCriteria.Movie.ImdbId.IsNotNullOrWhiteSpace()) { diff --git a/src/NzbDrone.Core/Indexers/TorrentPotato/TorrentPotatoResponse.cs b/src/NzbDrone.Core/Indexers/TorrentPotato/TorrentPotatoResponse.cs index 9b8300405..b0551ca67 100644 --- a/src/NzbDrone.Core/Indexers/TorrentPotato/TorrentPotatoResponse.cs +++ b/src/NzbDrone.Core/Indexers/TorrentPotato/TorrentPotatoResponse.cs @@ -21,6 +21,7 @@ public class Result public int size { get; set; } public int leechers { get; set; } public int seeders { get; set; } + public DateTime publishdate { get; set; } } } diff --git a/src/NzbDrone.Core/Indexers/TorrentPotato/TorrentPotatoSettings.cs b/src/NzbDrone.Core/Indexers/TorrentPotato/TorrentPotatoSettings.cs index d0b902f5e..14c91e2d0 100644 --- a/src/NzbDrone.Core/Indexers/TorrentPotato/TorrentPotatoSettings.cs +++ b/src/NzbDrone.Core/Indexers/TorrentPotato/TorrentPotatoSettings.cs @@ -19,7 +19,7 @@ public class TorrentPotatoSettings : IProviderConfig public TorrentPotatoSettings() { - BaseUrl = ""; + BaseUrl = "http://127.0.0.1"; } [FieldDefinition(0, Label = "API URL", HelpText = "URL to TorrentPotato api.")]