TheRandomLabs / CurseAPI

A Java library for handling interactions with CurseForge.
MIT License
30 stars 3 forks source link

Fetching More Than One Page of Dependents #8

Closed brucethemoose closed 5 years ago

brucethemoose commented 5 years ago

Calling dependants() seems to only retrieve the first page/first 20 entries of dependants for any given project. For example:

Logging.getLogger().info(CurseProject.fromSlug("minecraft", "omlib").dependents());

Prints:


[DEBUG] Downloading document: https://www.curseforge.com/minecraft/mc-mods/omlib

[DEBUG] Downloaded document: https://www.curseforge.com/minecraft/mc-mods/omlib

[DEBUG] Downloading document: https://www.curseforge.com/minecraft/mc-mods/omlib/relations/dependents?page=1

[DEBUG] Downloaded document: https://www.curseforge.com/minecraft/mc-mods/omlib/relations/dependents?page=1

[INFO] [[title="Tek Lab Engine",url="https://www.curseforge.com/minecraft/modpacks/tek-lab-engine"], [title="[NR] Adapt",url="https://www.curseforge.com/minecraft/modpacks/adapt"], [title="{JAZSMP} Just another zombie survival mod pack",url="https://www.curseforge.com/minecraft/modpacks/jazsmp-just-another-zombie-survival-mod-pack"], [title="2Gether Forever",url="https://www.curseforge.com/minecraft/modpacks/gether-forever"], [title="A Balanced Breakfast",url="https://www.curseforge.com/minecraft/modpacks/a-balanced-breakfast-tech-magic-destruction"], [title="A Dogs Pack",url="https://www.curseforge.com/minecraft/modpacks/dogs-1-12-2-pack"], [title="A Furcraftian Tail - FOGCraft Goes West",url="https://www.curseforge.com/minecraft/modpacks/a-furcraftian-tail-fogcraft-goes-west"], [title="A Group of Abnormalities",url="https://www.curseforge.com/minecraft/modpacks/a-group-of-abnormalities"], [title="A Harsh Reality",url="https://www.curseforge.com/minecraft/modpacks/tfgcraft-presents-a-harsh-reality"], [title="A Healthy Balance",url="https://www.curseforge.com/minecraft/modpacks/a-healthy-balance"], [title="A hunt for adventure",url="https://www.curseforge.com/minecraft/modpacks/sscards55s-rpg-adventure-modpack"], [title="A Lions Pride",url="https://www.curseforge.com/minecraft/modpacks/a-lions-pride"], [title="A Martian Wasteland",url="https://www.curseforge.com/minecraft/modpacks/a-martian-wasteland"], [title="A Misfit's Guide",url="https://www.curseforge.com/minecraft/modpacks/a-misfits-guide"], [title="A New Home",url="https://www.curseforge.com/minecraft/modpacks/a-new-home"], [title="A Newer Dope Modpack",url="https://www.curseforge.com/minecraft/modpacks/adm2"], [title="a noobs adventures",url="https://www.curseforge.com/minecraft/modpacks/a-noobs-adventures"], [title="A Nuclear World",url="https://www.curseforge.com/minecraft/modpacks/a-nuclear-world"], [title="A Punch Of Mobs Respawned",url="https://www.curseforge.com/minecraft/modpacks/a-punch-of-mobs-respawned"], [title="A Scientist-Wizards Pack",url="https://www.curseforge.com/minecraft/modpacks/a-scientist-wizards-pack"]]

But there are 67 pages of dependents for that particular mod.

Now all this is way over my head, but Documents.iteratePages() seemingly iterates over multiple CurseForge pages to get results, yet it's only returning 1 page of relations. Is this intended? Is it a bug? Or am I just missing the syntax that will return all of a project's dependents?