| 22 | } |
| 23 | |
| 24 | std::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 | |
| 42 | std::pair<Task::Ptr, QByteArray*> ModrinthAPI::latestVersion(const QString& hash, |
| 43 | const QString& hash_format, |
no test coverage detected