1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00

Using a tiered fallback is safer in case there is another data-loss and ids get reset.

This commit is contained in:
Taloth Saldono 2016-05-11 19:06:35 +02:00
parent e2d6d374ab
commit c249ad5dbe

View File

@ -25,18 +25,18 @@ public virtual IndexerPageableRequestChain GetRecentRequests()
{
var pageableRequests = new IndexerPageableRequestChain();
var parameters = new BroadcastheNetTorrentQuery();
if (LastRecentTorrentID.HasValue)
{
parameters.Id = ">=" + (LastRecentTorrentID.Value - 100);
pageableRequests.Add(GetPagedRequests(MaxPages, new BroadcastheNetTorrentQuery()
{
Id = ">=" + (LastRecentTorrentID.Value - 100)
}));
}
else
pageableRequests.AddTier(GetPagedRequests(MaxPages, new BroadcastheNetTorrentQuery()
{
parameters.Age = "<=86400";
}
pageableRequests.Add(GetPagedRequests(MaxPages, parameters));
Age = "<=86400"
}));
return pageableRequests;
}
@ -101,7 +101,7 @@ public virtual IndexerPageableRequestChain GetSearchRequests(SeasonSearchCriteri
public virtual IndexerPageableRequestChain GetSearchRequests(DailyEpisodeSearchCriteria searchCriteria)
{
var pageableRequests = new IndexerPageableRequestChain();
var parameters = new BroadcastheNetTorrentQuery();
if (AddSeriesSearchParameters(parameters, searchCriteria))
{
@ -184,7 +184,7 @@ private IEnumerable<IndexerRequest> GetPagedRequests(int maxPages, BroadcastheNe
.Call("getTorrents", Settings.ApiKey, parameters, PageSize, 0);
builder.SuppressHttpError = true;
for (var page = 0; page < maxPages;page++)
for (var page = 0; page < maxPages; page++)
{
builder.JsonParameters[3] = page * PageSize;