| 45 | namespace LegacyFTB { |
| 46 | |
| 47 | void PackFetchTask::fetch() |
| 48 | { |
| 49 | publicPacks.clear(); |
| 50 | thirdPartyPacks.clear(); |
| 51 | |
| 52 | jobPtr.reset(new NetJob("LegacyFTB::ModpackFetch", m_network)); |
| 53 | |
| 54 | QUrl publicPacksUrl = QUrl(BuildConfig.LEGACY_FTB_CDN_BASE_URL + "static/modpacks.xml"); |
| 55 | qDebug() << "Downloading public version info from" << publicPacksUrl.toString(); |
| 56 | |
| 57 | auto [publicAction, publicResponse] = Net::ApiDownload::makeByteArray(publicPacksUrl); |
| 58 | jobPtr->addNetAction(publicAction); |
| 59 | |
| 60 | QUrl thirdPartyUrl = QUrl(BuildConfig.LEGACY_FTB_CDN_BASE_URL + "static/thirdparty.xml"); |
| 61 | qDebug() << "Downloading thirdparty version info from" << thirdPartyUrl.toString(); |
| 62 | |
| 63 | auto [thirdPartyAction, thirdPartyResponse] = Net::Download::makeByteArray(thirdPartyUrl); |
| 64 | jobPtr->addNetAction(thirdPartyAction); |
| 65 | |
| 66 | connect(jobPtr.get(), &NetJob::succeeded, this, |
| 67 | [this, publicResponse, thirdPartyResponse] { fileDownloadFinished(publicResponse, thirdPartyResponse); }); |
| 68 | connect(jobPtr.get(), &NetJob::failed, this, &PackFetchTask::fileDownloadFailed); |
| 69 | connect(jobPtr.get(), &NetJob::aborted, this, &PackFetchTask::fileDownloadAborted); |
| 70 | |
| 71 | jobPtr->start(); |
| 72 | } |
| 73 | |
| 74 | void PackFetchTask::fetchPrivate(const QStringList& toFetch) |
| 75 | { |
no test coverage detected