mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-17 21:44:48 -04:00
Fixed: (IPTorrents) Fix pagination when limit is zero
This commit is contained in:
@@ -20,7 +20,7 @@ namespace NzbDrone.Core.Indexers.Definitions
|
||||
{
|
||||
public override string Name => "IPTorrents";
|
||||
|
||||
public override string[] IndexerUrls => new string[]
|
||||
public override string[] IndexerUrls => new[]
|
||||
{
|
||||
"https://iptorrents.com/",
|
||||
"https://iptorrents.me/",
|
||||
@@ -46,7 +46,7 @@ namespace NzbDrone.Core.Indexers.Definitions
|
||||
|
||||
public override IIndexerRequestGenerator GetRequestGenerator()
|
||||
{
|
||||
return new IPTorrentsRequestGenerator() { Settings = Settings, Capabilities = Capabilities };
|
||||
return new IPTorrentsRequestGenerator { Settings = Settings, Capabilities = Capabilities };
|
||||
}
|
||||
|
||||
public override IParseIndexerResponse GetParser()
|
||||
@@ -64,21 +64,21 @@ namespace NzbDrone.Core.Indexers.Definitions
|
||||
var caps = new IndexerCapabilities
|
||||
{
|
||||
TvSearchParams = new List<TvSearchParam>
|
||||
{
|
||||
TvSearchParam.Q, TvSearchParam.Season, TvSearchParam.Ep, TvSearchParam.ImdbId
|
||||
},
|
||||
{
|
||||
TvSearchParam.Q, TvSearchParam.Season, TvSearchParam.Ep, TvSearchParam.ImdbId
|
||||
},
|
||||
MovieSearchParams = new List<MovieSearchParam>
|
||||
{
|
||||
MovieSearchParam.Q, MovieSearchParam.ImdbId
|
||||
},
|
||||
{
|
||||
MovieSearchParam.Q, MovieSearchParam.ImdbId
|
||||
},
|
||||
MusicSearchParams = new List<MusicSearchParam>
|
||||
{
|
||||
MusicSearchParam.Q
|
||||
},
|
||||
{
|
||||
MusicSearchParam.Q
|
||||
},
|
||||
BookSearchParams = new List<BookSearchParam>
|
||||
{
|
||||
BookSearchParam.Q
|
||||
}
|
||||
{
|
||||
BookSearchParam.Q
|
||||
}
|
||||
};
|
||||
|
||||
caps.Categories.AddCategoryMapping(72, NewznabStandardCategory.Movies, "Movies");
|
||||
@@ -161,10 +161,6 @@ namespace NzbDrone.Core.Indexers.Definitions
|
||||
public IPTorrentsSettings Settings { get; set; }
|
||||
public IndexerCapabilities Capabilities { get; set; }
|
||||
|
||||
public IPTorrentsRequestGenerator()
|
||||
{
|
||||
}
|
||||
|
||||
private IEnumerable<IndexerRequest> GetPagedRequests(string term, int[] categories, int limit, int offset, string imdbId = null)
|
||||
{
|
||||
var searchUrl = Settings.BaseUrl + "t";
|
||||
@@ -194,9 +190,16 @@ namespace NzbDrone.Core.Indexers.Definitions
|
||||
qc.Add(cat, string.Empty);
|
||||
}
|
||||
|
||||
qc.Add("p", ((offset / limit) + 1).ToString());
|
||||
if (offset > 0 && limit > 0)
|
||||
{
|
||||
var page = (int)(offset / limit) + 1;
|
||||
qc.Add("p", page.ToString());
|
||||
}
|
||||
|
||||
searchUrl = searchUrl + "?" + qc.GetQueryString();
|
||||
if (qc.Count > 0)
|
||||
{
|
||||
searchUrl += $"?{qc.GetQueryString()}";
|
||||
}
|
||||
|
||||
var request = new IndexerRequest(searchUrl, HttpAccept.Html);
|
||||
|
||||
@@ -356,10 +359,6 @@ namespace NzbDrone.Core.Indexers.Definitions
|
||||
|
||||
public class IPTorrentsSettings : CookieTorrentBaseSettings
|
||||
{
|
||||
public IPTorrentsSettings()
|
||||
{
|
||||
}
|
||||
|
||||
[FieldDefinition(2, Label = "Cookie User-Agent", Type = FieldType.Textbox, HelpText = "User-Agent associated with cookie used from Browser")]
|
||||
public string UserAgent { get; set; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user