MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / getFiles

Method getFiles

launcher/modplatform/flame/FlameAPI.cpp:178–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

176}
177
178Task::Ptr FlameAPI::getFiles(const QStringList& fileIds, std::shared_ptr<QByteArray> response) const
179{
180 auto netJob = makeShared<NetJob>(QString("Flame::GetFiles"), APPLICATION->network());
181
182 QJsonObject body_obj;
183 QJsonArray files_arr;
184 for (auto& fileId : fileIds) {
185 files_arr.append(fileId);
186 }
187
188 body_obj["fileIds"] = files_arr;
189
190 QJsonDocument body(body_obj);
191 auto body_raw = body.toJson();
192
193 netJob->addNetAction(Net::ApiUpload::makeByteArray(QString("https://api.curseforge.com/v1/mods/files"), response, body_raw));
194
195 QObject::connect(netJob.get(), &NetJob::failed, [body_raw] { qDebug() << body_raw; });
196
197 return netJob;
198}
199
200Task::Ptr FlameAPI::getFile(const QString& addonId, const QString& fileId, std::shared_ptr<QByteArray> response) const
201{

Callers 2

updateInstanceMethod · 0.80
executeTaskMethod · 0.80

Calls 6

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

Tested by

no test coverage detected