| 125 | } |
| 126 | |
| 127 | std::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 | |
| 150 | std::pair<Task::Ptr, QByteArray*> FlameAPI::getFile(const QString& addonId, const QString& fileId) const |
| 151 | { |
no test coverage detected