MCPcopy Create free account
hub / github.com/ElyPrismLauncher/Launcher / currentVersions

Method currentVersions

launcher/modplatform/modrinth/ModrinthAPI.cpp:24–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22}
23
24std::pair<Task::Ptr, QByteArray*> ModrinthAPI::currentVersions(const QStringList& hashes, QString hash_format) const
25{
26 auto netJob = makeShared<NetJob>(QString("Modrinth::GetCurrentVersions"), APPLICATION->network());
27
28 QJsonObject body_obj;
29
30 Json::writeStringList(body_obj, "hashes", hashes);
31 Json::writeString(body_obj, "algorithm", hash_format);
32
33 QJsonDocument body(body_obj);
34 auto body_raw = body.toJson();
35
36 auto [action, response] = Net::ApiUpload::makeByteArray(QString(BuildConfig.MODRINTH_PROD_URL + "/version_files"), body_raw);
37 netJob->addNetAction(action);
38 netJob->setAskRetry(false);
39 return { netJob, response };
40}
41
42std::pair<Task::Ptr, QByteArray*> ModrinthAPI::latestVersion(const QString& hash,
43 const QString& hash_format,

Callers 3

modrinthVersionsTaskMethod · 0.80
netJobFinishedMethod · 0.80
makeApiRequestMethod · 0.80

Calls 7

writeStringListFunction · 0.85
writeStringFunction · 0.85
networkMethod · 0.80
toJsonMethod · 0.80
addNetActionMethod · 0.80
setAskRetryMethod · 0.80
QStringClass · 0.50

Tested by

no test coverage detected