MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / currentVersions

Method currentVersions

launcher/modplatform/modrinth/ModrinthAPI.cpp:19–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17}
18
19auto ModrinthAPI::currentVersions(const QStringList& hashes, QString hash_format, QByteArray* response) -> NetJob::Ptr
20{
21 auto* netJob = new NetJob(QString("Modrinth::GetCurrentVersions"), APPLICATION->network());
22
23 QJsonObject body_obj;
24
25 Json::writeStringList(body_obj, "hashes", hashes);
26 Json::writeString(body_obj, "algorithm", hash_format);
27
28 QJsonDocument body(body_obj);
29 auto body_raw = body.toJson();
30
31 netJob->addNetAction(Net::Upload::makeByteArray(QString(BuildConfig.MODRINTH_PROD_URL + "/version_files"), response, body_raw));
32
33 QObject::connect(netJob, &NetJob::finished, [response] { delete response; });
34
35 return netJob;
36}
37
38auto ModrinthAPI::latestVersion(QString hash,
39 QString hash_format,

Callers 1

modrinthVersionsTaskMethod · 0.80

Calls 6

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

Tested by

no test coverage detected