1
0
Fork 0
mirror of https://github.com/HamletDuFromage/aio-switch-updater.git synced 2024-11-09 12:01:44 +00:00

fix payload downloads

This commit is contained in:
flb 2021-09-28 14:43:48 +02:00
parent cf9ad1d51a
commit 888c576c84
5 changed files with 17 additions and 16 deletions

View file

@ -134,7 +134,8 @@
"tools": "Tools",
"launch_warning": "Please pay attention to the following points before using the app:\n\n\ue016 Read up on how to manually update your Switch first. This will help you understand the app better and you'll know what to do in case something goes wrong.\n\ue016 Please note that using this app on a exFAT SD card is STRONGLY discouraged, as those are likely to corrupt.\n\n\ue016 Some new features and/or changes regarding current features may have been introduced. Please check them out via the Tools->Changelog menu.\n\nThis screen won't show again.",
"footer_text": "v{} | {:.1f}GB available",
"theme_warning": "It seems like you have a custom theme installed, this may cause your system to fail to boot after upgrading your firmware.\nPlease consider deleting it before upgrading."
"theme_warning": "It seems like you have a custom theme installed, this may cause your system to fail to boot after upgrading your firmware.\nPlease consider deleting it before upgrading.",
"payloads_label": "\ue016 Download RCM payloads to {}"
},
"hide": {
"title": "Hide tabs",
@ -185,7 +186,7 @@
"cant_fetch_deepsea": "Couldn't fetch packages. Open a Github issue if this persists.",
"build_your_deepsea": "Build your own custom DeepSea package by selecting packages",
"getting_ams": "Getting Atmosphère",
"custom_packs_label": "Here are packs listed in the {} file. Be aware that those are not endorsed by aio-switch-updater so make sure you trust their source."
"custom_packs_label": "\ue016 Here are packs listed in the {} file. Be aware that those are not endorsed by aio-switch-updater so make sure you trust their source."
},
"firmware": {
"launch_daybreak": "Do you want to launch Daybreak to install the downloaded sysupdate?"

View file

@ -182,7 +182,7 @@
"cant_fetch_deepsea": "パッケージをフェッチできませんでした。これが続く場合は、Githubの問題を開きます。",
"build_your_deepsea": "パッケージを選択して、独自のカスタムDeepSeaパッケージを作成します",
"getting_ams": "Atmosphère取得中",
"custom_packs_label": "{} ファイルにリストされているパックは次のとおりです。 それらはaio-switch-updaterによって承認されていないことに注意してください。そのため、それらのソースを信頼していることを確認してください。"
"custom_packs_label": "\ue016 {} ファイルにリストされているパックは次のとおりです。 それらはaio-switch-updaterによって承認されていないことに注意してください。そのため、それらのソースを信頼していることを確認してください。"
},
"net": {
"title": "インターネット設定"

View file

@ -183,7 +183,7 @@
"cant_fetch_deepsea": "無法取得安裝包內容。如果問題持續發生請使用Github提出問題來進行回報",
"build_your_deepsea": "透過個別選取來建立屬於你自己的自訂DeepSea安裝包",
"getting_ams": "正在擷取 Atmosphère",
"custom_packs_label": "來自 {} 的檔案。請注意這些列出的檔案均未經過aio-switch-updater驗證因此安裝前請確保檔案來源為可信任的。"
"custom_packs_label": "\ue016 來自 {} 的檔案。請注意這些列出的檔案均未經過aio-switch-updater驗證因此安裝前請確保檔案來源為可信任的。"
},
"firmware": {
"launch_daybreak": "請問是否要執行Daybreak來安裝已下載的更新系統套件?"

View file

@ -36,7 +36,7 @@ ListDownloadTab::ListDownloadTab(const contentType type, const nlohmann::ordered
if (this->type == contentType::bootloaders) {
brls::Label* payloadsLabel = new brls::Label(
brls::LabelStyle::DESCRIPTION,
"menus/cheats/cheats_label"_i18n,
fmt::format("menus/main/payloads_label"_i18n, BOOTLOADER_PL_PATH),
true);
this->addView(payloadsLabel);
createList(contentType::payloads);
@ -63,18 +63,18 @@ void ListDownloadTab::createList(contentType type)
brls::StagedAppletFrame* stagedFrame = new brls::StagedAppletFrame();
stagedFrame->setTitle(fmt::format("menus/main/getting"_i18n, contentTypeNames[(int)type].data()));
stagedFrame->addStage(new ConfirmPage(stagedFrame, text));
if (type != contentType::payloads || type != contentType::cheats || this->newCheatsVer != this->currentCheatsVer || !std::filesystem::exists(CHEATS_ZIP_PATH)) {
stagedFrame->addStage(new WorkerPage(stagedFrame, "menus/common/downloading"_i18n, [type, url]() { util::downloadArchive(url, type); }));
}
if (type == contentType::payloads) {
fs::createTree(BOOTLOADER_PL_PATH);
std::string path = std::string(BOOTLOADER_PL_PATH) + title;
// TODO figure out why this doesn't work lol
stagedFrame->addStage(new WorkerPage(stagedFrame, "menus/common/downloading"_i18n, [url, path]() { download::downloadFile(url, path, OFF); }));
}
else {
if (type != contentType::payloads) {
if (type != contentType::cheats || this->newCheatsVer != this->currentCheatsVer || !std::filesystem::exists(CHEATS_ZIP_PATH)) {
stagedFrame->addStage(new WorkerPage(stagedFrame, "menus/common/downloading"_i18n, [type, url]() { util::downloadArchive(url, type); }));
}
stagedFrame->addStage(new WorkerPage(stagedFrame, "menus/common/extracting"_i18n, [type]() { util::extractArchive(type); }));
}
else {
fs::createTree(BOOTLOADER_PL_PATH);
std::string path = std::string(BOOTLOADER_PL_PATH) + title;
stagedFrame->addStage(new WorkerPage(stagedFrame, "menus/common/downloading"_i18n, [url, path]() { download::downloadFile(url, path, OFF); }));
}
std::string doneMsg = "menus/common/all_done"_i18n;
switch (type) {
case contentType::fw: {

View file

@ -37,10 +37,10 @@ void WorkerPage::draw(NVGcontext* vg, int x, int y, unsigned width, unsigned hei
{
if (this->draw_page) {
if (!this->workStarted) {
this->workStarted = true;
appletSetMediaPlaybackState(true);
appletBeginBlockingHomeButton(0);
ProgressEvent::instance().reset();
this->workStarted = true;
workerThread = new std::thread(&WorkerPage::doWork, this);
}
else if (ProgressEvent::instance().finished()) {