shosetsuorg / kotlin-lib

MOVED TO GITLAB: Shosetsu - Base Library and Lua Support
https://gitlab.com/shosetsuorg/kotlin-lib
GNU General Public License v3.0
6 stars 17 forks source link

Shosetsu has no way to know if there is no more pages #38

Open Doomsdayrs opened 2 years ago

Doomsdayrs commented 2 years ago

Description

When Shosetsu calls for results, either from a search or listing, there is no way to know if there are no more results. Leading to an unfortunate situation where Shosetsu will spam for a result.

Solution

Create a Result data class, parameters of the "Array" and "hasNextPage"

TechnoJo4 commented 2 years ago

Isn't returning empty or null fine?

TechnoJo4 commented 2 years ago

If we do rework this, I'd like for us to get a way to pass data across pages.

Some websites give you a key on each request that you need to request the next page, these websites are currently impossible to support in Shosetsu.

Dunbock commented 2 years ago

Why is that not possible right now? Can you not just make a local variable in an extension to save that value? Then you use that value when opening the next page. And in case of the first page you just ignore the variable.

TechnoJo4 commented 2 years ago

My opinion is that you shouldn't have to use a unintuitive workaround to implement something, and those things you have to use workarounds for should be considered impossible (with the tools shosetsu gives you), even if they are actually possible.