dandels / dmodman

TUI downloader & update checker for Nexusmods.com
MIT License
42 stars 0 forks source link

[feature request] Support for downloading mod collections #16

Open ezioleq opened 7 months ago

ezioleq commented 7 months ago

Downloading all the mods from a collection or collection itself (not sure about how does it work technically in Vortex etc.) would be a huge improvement in my opinion. I'm also aware that this feature may be pretty complicated to implement but definitely it's a topic worth considering.

Currently it obviously doesn't work and when given an collection URL as an argument, for example, dmodman "nxm://cyberpunk2077/collections/dfvt7o/revisions/55" we will see an error message in the application 0: Unable to parse nxm string "nxm://cyberpunk2077/collections/dfvt7o/revisions/55" invalid digit found in string.

Anyway, it's a great project and I'll definitely be using it :)

dandels commented 7 months ago

Thank you for the positive feedback!

It seems I need to add support for the upcoming v2 GraphQL API in order to implement this. I went and asked in Nexus's Discord server about this, and got this response:

The V2 API is not production ready so I highly discourage using it. If you do choose to support collections you'd have to ensure that it works with Vortex in the same way otherwise it'll cause problems for users As you pointed out. The docs aren't done. This is because the project is not finished and we don't support third party apps using it until we officially announce it

This is an important feature and one I'm definitely looking to implement (contributions welcome! I should work on tests and documentation to make it easier). There's a few hurdles in the way though, and since I've suddenly transformed into a responsible parent I have less time for programming. I might thus end up waiting for the proper release of the v2 API.

Since the new API is GraphQL based, its implementation would pretty much have to be written from scratch. The data structures returned by the v1 API are also used internally all over the place, so it might be a better idea to move entirely over to the new API when it's released. The transition should also make the code a lot simpler - currently dmodman needs to perform several requests to piece together the data it needs for one mod download, and it keeps complicated mappings between the data types.

It might be possible to do some kind of MVP implementation using the current code as far as possible, but I suspect that would perform a lot of API request and hit the hourly request limits for bigger collections.