diff options
author | flow <flowlnlnln@gmail.com> | 2022-06-03 19:04:49 -0300 |
---|---|---|
committer | flow <flowlnlnln@gmail.com> | 2022-07-17 11:33:41 -0300 |
commit | 0e52112016fe9942f7448cd83914f6266904c311 (patch) | |
tree | fb873a3a6920d1ae4f5751f747864dd6283e0556 /launcher/modplatform/modrinth/ModrinthAPI.h | |
parent | 32a9545360b10058cf84b951ee88959adf3bf374 (diff) | |
download | PrismLauncher-0e52112016fe9942f7448cd83914f6266904c311.tar.gz PrismLauncher-0e52112016fe9942f7448cd83914f6266904c311.tar.bz2 PrismLauncher-0e52112016fe9942f7448cd83914f6266904c311.zip |
feat: add some api calls to modrinth
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>
Diffstat (limited to 'launcher/modplatform/modrinth/ModrinthAPI.h')
-rw-r--r-- | launcher/modplatform/modrinth/ModrinthAPI.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/launcher/modplatform/modrinth/ModrinthAPI.h b/launcher/modplatform/modrinth/ModrinthAPI.h index 89e52d6c..9694b85e 100644 --- a/launcher/modplatform/modrinth/ModrinthAPI.h +++ b/launcher/modplatform/modrinth/ModrinthAPI.h @@ -22,11 +22,33 @@ #include "modplatform/ModAPI.h" #include "modplatform/ModIndex.h" #include "modplatform/helpers/NetworkModAPI.h" +#include "net/NetJob.h" #include <QDebug> class ModrinthAPI : public NetworkModAPI { public: + auto currentVersion(QString hash, + QString hash_format, + QByteArray* response) -> NetJob::Ptr; + + auto currentVersions(const QStringList& hashes, + QString hash_format, + QByteArray* response) -> NetJob::Ptr; + + auto latestVersion(QString hash, + QString hash_format, + std::list<Version> mcVersions, + ModLoaderTypes loaders, + QByteArray* response) -> NetJob::Ptr; + + auto latestVersions(const QStringList& hashes, + QString hash_format, + std::list<Version> mcVersions, + ModLoaderTypes loaders, + QByteArray* response) -> NetJob::Ptr; + + public: inline auto getAuthorURL(const QString& name) const -> QString { return "https://modrinth.com/user/" + name; }; static auto getModLoaderStrings(const ModLoaderTypes types) -> const QStringList |