mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-31 04:04:21 -04:00
Remove invalid next/prev in pages sorted by random
This commit is contained in:
parent
9ba7cb1ba5
commit
eaec736676
@ -91,17 +91,20 @@ namespace Kyoo.Abstractions.Models
|
|||||||
Items = items;
|
Items = items;
|
||||||
This = url + query.ToQueryString();
|
This = url + query.ToQueryString();
|
||||||
|
|
||||||
if (items.Count > 0 && query.ContainsKey("afterID"))
|
if (!(query.TryGetValue("sortBy", out string? sort) && sort.Contains("random")))
|
||||||
{
|
{
|
||||||
query["afterID"] = items.First().Id.ToString();
|
if (items.Count > 0 && query.ContainsKey("afterID"))
|
||||||
query["reverse"] = "true";
|
{
|
||||||
Previous = url + query.ToQueryString();
|
query["afterID"] = items.First().Id.ToString();
|
||||||
}
|
query["reverse"] = "true";
|
||||||
query.Remove("reverse");
|
Previous = url + query.ToQueryString();
|
||||||
if (items.Count == limit && limit > 0)
|
}
|
||||||
{
|
query.Remove("reverse");
|
||||||
query["afterID"] = items.Last().Id.ToString();
|
if (items.Count == limit && limit > 0)
|
||||||
Next = url + query.ToQueryString();
|
{
|
||||||
|
query["afterID"] = items.Last().Id.ToString();
|
||||||
|
Next = url + query.ToQueryString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query.Remove("afterID");
|
query.Remove("afterID");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user