|
|
@ -94,18 +94,6 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|
|
|
_settings = settings;
|
|
|
|
_settings = settings;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private IEnumerable<IndexerRequest> GetPagedRequests(NebulanceQuery parameters, int? results, int? offset)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var apiUrl = _settings.BaseUrl + "api.php";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var builder = new JsonRpcRequestBuilder(apiUrl)
|
|
|
|
|
|
|
|
.Call("getTorrents", _settings.ApiKey, parameters, results ?? 100, offset ?? 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
builder.SuppressHttpError = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
yield return new IndexerRequest(builder.Build());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public IndexerPageableRequestChain GetSearchRequests(MovieSearchCriteria searchCriteria)
|
|
|
|
public IndexerPageableRequestChain GetSearchRequests(MovieSearchCriteria searchCriteria)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return new IndexerPageableRequestChain();
|
|
|
|
return new IndexerPageableRequestChain();
|
|
|
@ -151,6 +139,14 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|
|
|
|
|
|
|
|
|
|
|
pageableRequests.Add(GetPagedRequests(queryParams, searchCriteria.Limit, searchCriteria.Offset));
|
|
|
|
pageableRequests.Add(GetPagedRequests(queryParams, searchCriteria.Limit, searchCriteria.Offset));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (queryParams.Name.IsNotNullOrWhiteSpace() && (queryParams.Tvmaze is > 0 || queryParams.Imdb is > 0))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
queryParams = queryParams.Clone();
|
|
|
|
|
|
|
|
queryParams.Name = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pageableRequests.Add(GetPagedRequests(queryParams, searchCriteria.Limit, searchCriteria.Offset));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return pageableRequests;
|
|
|
|
return pageableRequests;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -178,6 +174,18 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|
|
|
return pageableRequests;
|
|
|
|
return pageableRequests;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private IEnumerable<IndexerRequest> GetPagedRequests(NebulanceQuery parameters, int? results, int? offset)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var apiUrl = _settings.BaseUrl + "api.php";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var builder = new JsonRpcRequestBuilder(apiUrl)
|
|
|
|
|
|
|
|
.Call("getTorrents", _settings.ApiKey, parameters, results ?? 100, offset ?? 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
builder.SuppressHttpError = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
yield return new IndexerRequest(builder.Build());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Func<IDictionary<string, string>> GetCookies { get; set; }
|
|
|
|
public Func<IDictionary<string, string>> GetCookies { get; set; }
|
|
|
|
public Action<IDictionary<string, string>, DateTime?> CookiesUpdater { get; set; }
|
|
|
|
public Action<IDictionary<string, string>, DateTime?> CookiesUpdater { get; set; }
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -264,17 +272,17 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|
|
|
public string Id { get; set; }
|
|
|
|
public string Id { get; set; }
|
|
|
|
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
|
|
|
|
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
|
|
|
|
public string Time { get; set; }
|
|
|
|
public string Time { get; set; }
|
|
|
|
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
|
|
|
|
[JsonProperty(PropertyName="age", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
|
|
|
public string Age { get; set; }
|
|
|
|
public string Age { get; set; }
|
|
|
|
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
|
|
|
|
[JsonProperty(PropertyName="tvmaze", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
|
|
|
public int Tvmaze { get; set; }
|
|
|
|
public int? Tvmaze { get; set; }
|
|
|
|
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
|
|
|
|
[JsonProperty(PropertyName="imdb", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
|
|
|
public int Imdb { get; set; }
|
|
|
|
public int? Imdb { get; set; }
|
|
|
|
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
|
|
|
|
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
|
|
|
|
public string Hash { get; set; }
|
|
|
|
public string Hash { get; set; }
|
|
|
|
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
|
|
|
|
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
|
|
|
|
public string[] Tags { get; set; }
|
|
|
|
public string[] Tags { get; set; }
|
|
|
|
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
|
|
|
|
[JsonProperty(PropertyName="name", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
|
|
|
public string Name { get; set; }
|
|
|
|
public string Name { get; set; }
|
|
|
|
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
|
|
|
|
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
|
|
|
|
public string Category { get; set; }
|
|
|
|
public string Category { get; set; }
|
|
|
|