mirror of
https://git.maid.zone/stuff/soundcloak.git
synced 2026-01-08 20:09:38 +05:00
fix pagination (pagination may not immediately return you something, so automatically proceed until something useful is found)
This commit is contained in:
@@ -210,6 +210,14 @@ func (p *Paginated[T]) Proceed() error {
|
||||
p.Next = ""
|
||||
}
|
||||
|
||||
// in soundcloud api, pagination may not immediately return you something!
|
||||
// loading users who haven't released anything recently may require you to do a bunch of requests for nothing :/
|
||||
// maybe there could be a way to cache the last useless layer of pagination so soundcloak can start loading from there? might be a bit complicated, but would be great
|
||||
if len(p.Collection) == 0 && p.Next != "" {
|
||||
// this will make sure that we actually proceed to something useful and not emptiness
|
||||
return p.Proceed()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user