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

Method getProjects

launcher/modplatform/flame/FlameAPI.cpp:156–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154}
155
156Task::Ptr FlameAPI::getProjects(QStringList addonIds, std::shared_ptr<QByteArray> response) const
157{
158 auto netJob = makeShared<NetJob>(QString("Flame::GetProjects"), APPLICATION->network());
159
160 QJsonObject body_obj;
161 QJsonArray addons_arr;
162 for (auto& addonId : addonIds) {
163 addons_arr.append(addonId);
164 }
165
166 body_obj["modIds"] = addons_arr;
167
168 QJsonDocument body(body_obj);
169 auto body_raw = body.toJson();
170
171 netJob->addNetAction(Net::ApiUpload::makeByteArray(QString("https://api.curseforge.com/v1/mods"), response, body_raw));
172
173 QObject::connect(netJob.get(), &NetJob::failed, [body_raw] { qDebug() << body_raw; });
174
175 return netJob;
176}
177
178Task::Ptr FlameAPI::getFiles(const QStringList& fileIds, std::shared_ptr<QByteArray> response) const
179{

Callers 4

modrinthProjectsTaskMethod · 0.45
flameProjectsTaskMethod · 0.45
getProjectsInfoMethod · 0.45
getFlameProjectsMethod · 0.45

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