MCPcopy Create free account
hub / github.com/ElyPrismLauncher/Launcher / getFiles

Method getFiles

launcher/modplatform/flame/FlameAPI.cpp:127–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125}
126
127std::pair<Task::Ptr, QByteArray*> FlameAPI::getFiles(const QStringList& fileIds) const
128{
129 auto netJob = makeShared<NetJob>(QString("Flame::GetFiles"), APPLICATION->network());
130
131 QJsonObject body_obj;
132 QJsonArray files_arr;
133 for (auto& fileId : fileIds) {
134 files_arr.append(fileId);
135 }
136
137 body_obj["fileIds"] = files_arr;
138
139 QJsonDocument body(body_obj);
140 auto body_raw = body.toJson();
141
142 auto [action, response] = Net::ApiUpload::makeByteArray(QString(BuildConfig.FLAME_BASE_URL + "/mods/files"), body_raw);
143 netJob->addNetAction(action);
144
145 QObject::connect(netJob.get(), &NetJob::failed, [body_raw] { qDebug() << body_raw; });
146
147 return { netJob, response };
148}
149
150std::pair<Task::Ptr, QByteArray*> FlameAPI::getFile(const QString& addonId, const QString& fileId) const
151{

Callers 4

updateInstanceMethod · 0.45
executeTaskMethod · 0.45
contains_level_datFunction · 0.45
processZIPFunction · 0.45

Calls 6

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

Tested by

no test coverage detected