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

Method getProjects

launcher/modplatform/flame/FlameAPI.cpp:164–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162}
163
164auto FlameAPI::getProjects(QStringList addonIds, QByteArray* response) const -> NetJob*
165{
166 auto* netJob = new NetJob(QString("Flame::GetProjects"), APPLICATION->network());
167
168 QJsonObject body_obj;
169 QJsonArray addons_arr;
170 for (auto& addonId : addonIds) {
171 addons_arr.append(addonId);
172 }
173
174 body_obj["modIds"] = addons_arr;
175
176 QJsonDocument body(body_obj);
177 auto body_raw = body.toJson();
178
179 netJob->addNetAction(Net::Upload::makeByteArray(QString("https://api.curseforge.com/v1/mods"), response, body_raw));
180
181 QObject::connect(netJob, &NetJob::finished, [response, netJob] { delete response; netJob->deleteLater(); });
182 QObject::connect(netJob, &NetJob::failed, [body_raw] { qDebug() << body_raw; });
183
184 return netJob;
185}
186
187auto FlameAPI::getFiles(const QStringList& fileIds, QByteArray* response) const -> NetJob*
188{

Callers 2

modrinthProjectsTaskMethod · 0.45
flameProjectsTaskMethod · 0.45

Calls 5

QStringClass · 0.85
networkMethod · 0.80
appendMethod · 0.80
toJsonMethod · 0.80
addNetActionMethod · 0.80

Tested by

no test coverage detected