aboutsummaryrefslogtreecommitdiff
path: root/launcher/modplatform/modrinth/ModrinthAPI.h
AgeCommit message (Collapse)Author
2023-02-05feat(RD): add shader pack downloaderflow
Signed-off-by: flow <flowlnlnln@gmail.com>
2023-02-05feat(RD): add resource pack downloaderflow
Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-23fix(license): add/fix my copyright/license headersflow
*sobbing in messy legal stuff i know nothing about* Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-13refactor: change some ResourceAPI from NetJob to Taskflow
This makes it easier to create resource apis that aren't network-based. Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-13refactor(RD): clear up sorting methodsflow
This refactors the sorting methods to join every bit of it into a single list, easing maintanance. It also removes the weird index contraint on the list of methods by adding an index field to the DS that holds the method. Lastly, it puts the available methods on their respective API, so other resources on the same API can re-use them later on. Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-13refactor(RD): decouple ResourceModels from ResourcePagesflow
This makes it so that we don't need a reference to the parent page in the model. It will be useful once we change the page from a widget-based one to a QML page. It also makes tasks be created in the dialog instead of the page, so that the dialog can also have the necessary information to mark versions as selected / deselected easily. It also makes the task pointers into smart pointers. Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-13refactor: generalize mod models and APIs to resourcesflow
Firstly, this abstract away behavior in the mod download models that can also be applied to other types of resources into a superclass, allowing other resource types to be implemented without so much code duplication. For that, this also generalizes the APIs used (currently, ModrinthAPI and FlameAPI) to be able to make requests to other types of resources. It also does a general cleanup of both of those. In particular, this makes use of std::optional instead of invalid values for errors and, well, optional values :p This is a squash of some commits that were becoming too interlaced together to be cleanly separated. Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17fix: don't use shared_ptr for a background task T_Tflow
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17feat: add some mod api callsflow
- Get Project: Already existed but required a specific caller type. This is more general. - Get Projects: A single call to multiple of the above Both providers support these calls. Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17feat: add some api calls to modrinthflow
Calls added: - Get version from hash - Get versions from hashes - Latest version of a project from a hash, loader(s), and game version(s) - Latest versions of multiple project from hashes, loader(s), and game version(s) Some of those are not used yet, but may be of use later on, so we have it if we need it :) Signed-off-by: flow <flowlnlnln@gmail.com>
2022-06-14Merge pull request #634 from flowln/donate_linksEzekiel Smith
More links for CF / Modrinth mods / modpacks
2022-06-04Merge pull request #426 from flowln/mod_permaSefa Eyeoglu
Add on-disk mod metadata information
2022-05-29Fix modrinth search filterstimoreo
2022-05-24feat: add donate links for modrinth modsflow
2022-05-23refactor: move code out of ModIndex.hflow
Now it's in ModIndex.cpp
2022-05-19chore: improve readabilitySefa Eyeoglu
Co-authored-by: flow <thiagodonato300@gmail.com>
2022-05-19refactor: allow tracking multiple mod loadersSefa Eyeoglu
2022-05-15chore: license headers 2flow
2022-05-15chore: add/update license headersSefa Eyeoglu
2022-05-15change: use build variables for the modrinth API URLsflow
Make it more consistent with the others
2022-04-19fix: fix Modrinth query when Quilt is in useSefa Eyeoglu
2022-04-16fix: query for Fabric mods if Quilt is in useSefa Eyeoglu
Right now we want to include Fabric mods in our searches where possible. Modrinth allows definining multiple loaders, while Flame only allows a single value. As a compromise we ask for Fabric mods only on Flame and for both Fabric and Quilt mods on Modrinth.
2022-04-15fix: 'All' filter working and get around CF API capabilitiesflow
2022-04-15fix(ui): Refresh mod list when changing filtering optionsflow
2022-04-15feat: Use version filter when searching modsflow
2022-04-14refactor: cleanup ModLoaderTypeSefa Eyeoglu
2022-04-07fix: check for Quilt as Fabric-compatible loaderSefa Eyeoglu
2022-03-24optimize: Improve mod versions request to Modrinthflow
This uses more arguments in the GET request for mod versions on the Modrinth API, filtering what versions can be returned, decreasing load on Modrinth servers and improving a little the time it takes for the versions to be available to the user. This also removes the now unneeded check on correct modloaders in ModrinthPackIndex, since it is now filtered by the Modrinth server. Lastly, this adds a couple of helper functions in ModModel.
2022-03-14tidy: Fix clang-tidy issues on files changed in this PRflow
The checks used are roughly the same as the ones proposed in the clang-tidy PR (except perhaps that I used modernize-* instead of listing them individually,though I don't think this caused any readability detriments). In ModrinthModel.cpp and FlameModModel.cpp I ignored the modernize-avoid-c-arrays one, mostly because making the sorts array an std::array would most likely increase the code complexity because of the virtual function. Aside from that, the static_cast warning from Application.h was not dealt with, since it's not in this PR's scope.
2022-03-07refactor: de-duplicate common code in network mod APIsflow
2022-03-07refactor: move NetJob away from ModModel to ModAPIflow
This is done so that 1. ModAPI behaves more like an actual API instead of just a helper, and 2. Allows for more easily creating other mod providers that may or may not use network tasks (foreshadowing lol)
2022-03-06refactor: use Enum instead of raw int for ModLoaderTypeflow
2022-03-02refactor: move url creation for mods to modplatform/flow
Moves all things related to creating the URLs of the mod platforms that go to network tasks to a single place, so that: 1. Maintaining and fixing eventual issues is more straightforward. 2. Makes it possible to factor out more common code between the different modplatform pages