From dd5049b4838beddf74e8677d19715f23886c51a4 Mon Sep 17 00:00:00 2001 From: Devin Buhl Date: Fri, 13 Jan 2017 21:55:07 -0500 Subject: [PATCH] Add rss sync to awesome-hd --- src/NzbDrone.Core/Indexers/AwesomeHD/AwesomeHD.cs | 2 +- .../Indexers/AwesomeHD/AwesomeHDRequestGenerator.cs | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/NzbDrone.Core/Indexers/AwesomeHD/AwesomeHD.cs b/src/NzbDrone.Core/Indexers/AwesomeHD/AwesomeHD.cs index 2ecb61b84..afe7892a0 100644 --- a/src/NzbDrone.Core/Indexers/AwesomeHD/AwesomeHD.cs +++ b/src/NzbDrone.Core/Indexers/AwesomeHD/AwesomeHD.cs @@ -9,7 +9,7 @@ public class AwesomeHD : HttpIndexerBase { public override string Name => "AwesomeHD"; public override DownloadProtocol Protocol => DownloadProtocol.Torrent; - public override bool SupportsRss => false; + public override bool SupportsRss => true; public override bool SupportsSearch => true; public override int PageSize => 50; diff --git a/src/NzbDrone.Core/Indexers/AwesomeHD/AwesomeHDRequestGenerator.cs b/src/NzbDrone.Core/Indexers/AwesomeHD/AwesomeHDRequestGenerator.cs index 7e42f9ad6..00289d7e4 100644 --- a/src/NzbDrone.Core/Indexers/AwesomeHD/AwesomeHDRequestGenerator.cs +++ b/src/NzbDrone.Core/Indexers/AwesomeHD/AwesomeHDRequestGenerator.cs @@ -15,7 +15,7 @@ public virtual IndexerPageableRequestChain GetRecentRequests() { var pageableRequests = new IndexerPageableRequestChain(); - pageableRequests.Add(GetRequest("tt2488496")); + pageableRequests.Add(GetRequest(null)); return pageableRequests; } @@ -54,8 +54,15 @@ public IndexerPageableRequestChain GetSearchRequests(MovieSearchCriteria searchC private IEnumerable GetRequest(string searchParameters) { - var request = new IndexerRequest(string.Format("{0}/searchapi.php?action=imdbsearch&passkey={1}&imdb={2}", Settings.BaseUrl.Trim().TrimEnd('/'), Settings.Passkey.Trim(), searchParameters), HttpAccept.Rss); - yield return request; + if (searchParameters != null) + { + yield return new IndexerRequest(string.Format("{0}/searchapi.php?action=imdbsearch&passkey={1}&imdb={2}", Settings.BaseUrl.Trim().TrimEnd('/'), Settings.Passkey.Trim(), searchParameters), HttpAccept.Rss); + } + else + { + yield return new IndexerRequest(string.Format("{0}/searchapi.php?action=latestmovies&passkey={1}", Settings.BaseUrl.Trim().TrimEnd('/'), Settings.Passkey.Trim()), HttpAccept.Rss); + } + } } }