| 17 | } |
| 18 | |
| 19 | auto 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 | |
| 38 | auto ModrinthAPI::latestVersion(QString hash, |
| 39 | QString hash_format, |
no test coverage detected