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

Method getFiles

launcher/modplatform/flame/FlameAPI.cpp:187–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185}
186
187auto FlameAPI::getFiles(const QStringList& fileIds, QByteArray* response) const -> NetJob*
188{
189 auto* netJob = new NetJob(QString("Flame::GetFiles"), APPLICATION->network());
190
191 QJsonObject body_obj;
192 QJsonArray files_arr;
193 for (auto& fileId : fileIds) {
194 files_arr.append(fileId);
195 }
196
197 body_obj["fileIds"] = files_arr;
198
199 QJsonDocument body(body_obj);
200 auto body_raw = body.toJson();
201
202 netJob->addNetAction(Net::Upload::makeByteArray(QString("https://api.curseforge.com/v1/mods/files"), response, body_raw));
203
204 QObject::connect(netJob, &NetJob::finished, [response, netJob] { delete response; netJob->deleteLater(); });
205 QObject::connect(netJob, &NetJob::failed, [body_raw] { qDebug() << body_raw; });
206
207 return netJob;
208}

Callers 1

updateInstanceMethod · 0.80

Calls 5

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

Tested by

no test coverage detected