Merge pull request #160 from Radarr/patch/fix-newznab

fix some spelling mistakes and update the newznab api 'imdbid'
pull/2/head
Leonardo Galli 8 years ago committed by GitHub
commit b7f72c6259

@ -106,8 +106,8 @@ namespace NzbDrone.Core.Indexers.Newznab
} }
if (capabilities.SupportedTvSearchParameters != null && if (capabilities.SupportedTvSearchParameters != null &&
new[] { "q", "imdb" }.Any(v => capabilities.SupportedMovieSearchParamters.Contains(v)) && new[] { "q", "imdbid" }.Any(v => capabilities.SupportedMovieSearchParameters.Contains(v)) &&
new[] { "imdbtitle", "imdbyear" }.All(v => capabilities.SupportedMovieSearchParamters.Contains(v))) new[] { "imdbtitle", "imdbyear" }.All(v => capabilities.SupportedMovieSearchParameters.Contains(v)))
{ {
return null; return null;
} }

@ -8,7 +8,7 @@ namespace NzbDrone.Core.Indexers.Newznab
public int MaxPageSize { get; set; } public int MaxPageSize { get; set; }
public string[] SupportedSearchParameters { get; set; } public string[] SupportedSearchParameters { get; set; }
public string[] SupportedTvSearchParameters { get; set; } public string[] SupportedTvSearchParameters { get; set; }
public string[] SupportedMovieSearchParamters { get; set; } public string[] SupportedMovieSearchParameters { get; set; }
public bool SupportsAggregateIdSearch { get; set; } public bool SupportsAggregateIdSearch { get; set; }
public List<NewznabCategory> Categories { get; set; } public List<NewznabCategory> Categories { get; set; }
@ -17,7 +17,7 @@ namespace NzbDrone.Core.Indexers.Newznab
DefaultPageSize = 100; DefaultPageSize = 100;
MaxPageSize = 100; MaxPageSize = 100;
SupportedSearchParameters = new[] { "q" }; SupportedSearchParameters = new[] { "q" };
SupportedMovieSearchParamters = new[] { "q", "imdb", "imdbtitle", "imdbyear" }; SupportedMovieSearchParameters = new[] { "q", "imdbid", "imdbtitle", "imdbyear" };
SupportedTvSearchParameters = new[] { "q", "rid", "season", "ep" }; // This should remain 'rid' for older newznab installs. SupportedTvSearchParameters = new[] { "q", "rid", "season", "ep" }; // This should remain 'rid' for older newznab installs.
SupportsAggregateIdSearch = false; SupportsAggregateIdSearch = false;
Categories = new List<NewznabCategory>(); Categories = new List<NewznabCategory>();

@ -102,11 +102,11 @@ namespace NzbDrone.Core.Indexers.Newznab
var xmlMovieSearch = xmlSearching.Element("movie-search"); var xmlMovieSearch = xmlSearching.Element("movie-search");
if (xmlMovieSearch == null || xmlMovieSearch.Attribute("available").Value != "yes") if (xmlMovieSearch == null || xmlMovieSearch.Attribute("available").Value != "yes")
{ {
capabilities.SupportedMovieSearchParamters = null; capabilities.SupportedMovieSearchParameters = null;
} }
else if (xmlMovieSearch.Attribute("supportedParams") != null) else if (xmlMovieSearch.Attribute("supportedParams") != null)
{ {
capabilities.SupportedMovieSearchParamters = xmlMovieSearch.Attribute("supportedParams").Value.Split(','); capabilities.SupportedMovieSearchParameters = xmlMovieSearch.Attribute("supportedParams").Value.Split(',');
capabilities.SupportsAggregateIdSearch = true; capabilities.SupportsAggregateIdSearch = true;
} }
} }

@ -91,8 +91,8 @@ namespace NzbDrone.Core.Indexers.Newznab
{ {
var capabilities = _capabilitiesProvider.GetCapabilities(Settings); var capabilities = _capabilitiesProvider.GetCapabilities(Settings);
return capabilities.SupportedMovieSearchParamters != null && return capabilities.SupportedMovieSearchParameters != null &&
capabilities.SupportedMovieSearchParamters.Contains("imdbid"); capabilities.SupportedMovieSearchParameters.Contains("imdbid");
} }
} }
@ -112,7 +112,7 @@ namespace NzbDrone.Core.Indexers.Newznab
var capabilities = _capabilitiesProvider.GetCapabilities(Settings); var capabilities = _capabilitiesProvider.GetCapabilities(Settings);
if (capabilities.SupportedMovieSearchParamters != null) if (capabilities.SupportedMovieSearchParameters != null)
{ {
pageableRequests.Add(GetPagedRequests(MaxPages, Settings.Categories.Concat(Settings.AnimeCategories), "movie", "")); pageableRequests.Add(GetPagedRequests(MaxPages, Settings.Categories.Concat(Settings.AnimeCategories), "movie", ""));
} }
@ -124,7 +124,7 @@ namespace NzbDrone.Core.Indexers.Newznab
{ {
var pageableRequests = new IndexerPageableRequestChain(); var pageableRequests = new IndexerPageableRequestChain();
if(SupportsMovieSearch) if (SupportsMovieSearch)
{ {
pageableRequests.Add(GetPagedRequests(MaxPages, Settings.Categories, "movie", pageableRequests.Add(GetPagedRequests(MaxPages, Settings.Categories, "movie",
string.Format("&imdbid={0}", searchCriteria.Movie.ImdbId.Substring(2)))); //strip off the "tt" - VERY HACKY string.Format("&imdbid={0}", searchCriteria.Movie.ImdbId.Substring(2)))); //strip off the "tt" - VERY HACKY

Loading…
Cancel
Save