MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / currentVersions

Method currentVersions

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

Source from the content-addressed store, hash-verified

22}
23
24Task::Ptr ModrinthAPI::currentVersions(const QStringList& hashes, QString hash_format, std::shared_ptr<QByteArray> response)
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 netJob->addNetAction(Net::ApiUpload::makeByteArray(QString(BuildConfig.MODRINTH_PROD_URL + "/version_files"), response, body_raw));
37 netJob->setAskRetry(false);
38 return netJob;
39}
40
41Task::Ptr ModrinthAPI::latestVersion(QString hash,
42 QString hash_format,

Callers 3

modrinthVersionsTaskMethod · 0.80
netJobFinishedMethod · 0.80
makeApiRequestMethod · 0.80

Calls 7

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

Tested by

no test coverage detected