| 22 | } |
| 23 | |
| 24 | Task::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 | |
| 41 | Task::Ptr ModrinthAPI::latestVersion(QString hash, |
| 42 | QString hash_format, |
no test coverage detected