feat: add some mod api calls
- 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>
This commit is contained in:
@ -22,7 +22,6 @@
|
||||
#include "modplatform/ModAPI.h"
|
||||
#include "modplatform/ModIndex.h"
|
||||
#include "modplatform/helpers/NetworkModAPI.h"
|
||||
#include "net/NetJob.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
@ -48,6 +47,8 @@ class ModrinthAPI : public NetworkModAPI {
|
||||
ModLoaderTypes loaders,
|
||||
QByteArray* response) -> NetJob::Ptr;
|
||||
|
||||
auto getProjects(QStringList addonIds, QByteArray* response) const -> NetJob::Ptr override;
|
||||
|
||||
public:
|
||||
inline auto getAuthorURL(const QString& name) const -> QString { return "https://modrinth.com/user/" + name; };
|
||||
|
||||
@ -103,6 +104,11 @@ class ModrinthAPI : public NetworkModAPI {
|
||||
return BuildConfig.MODRINTH_PROD_URL + "/project/" + id;
|
||||
};
|
||||
|
||||
inline auto getMultipleModInfoURL(QStringList ids) const -> QString
|
||||
{
|
||||
return BuildConfig.MODRINTH_PROD_URL + QString("/projects?ids=[\"%1\"]").arg(ids.join("\",\""));
|
||||
};
|
||||
|
||||
inline auto getVersionsURL(VersionSearchArgs& args) const -> QString override
|
||||
{
|
||||
return QString(BuildConfig.MODRINTH_PROD_URL +
|
||||
|
Reference in New Issue
Block a user