| 176 | } |
| 177 | |
| 178 | Task::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 | |
| 200 | Task::Ptr FlameAPI::getFile(const QString& addonId, const QString& fileId, std::shared_ptr<QByteArray> response) const |
| 201 | { |