1
0
Fork 0
mirror of https://github.com/HamletDuFromage/aio-switch-updater.git synced 2024-12-28 02:16:03 +00:00

Keep compat with older app versions

This commit is contained in:
Angelo Elias Dalzotto 2022-04-25 11:40:07 -03:00
parent 39cdc2b037
commit 11fe274dc6
4 changed files with 8 additions and 2 deletions

View file

@ -118,9 +118,10 @@ enum class contentType
ams_cfw,
payloads,
hekate_ipl,
megafw,
};
constexpr std::string_view contentTypeNames[8]{"sigpatches", "cheats", "firmwares", "app", "bootloaders", "cfws", "payloads", "hekate_ipl"};
constexpr std::string_view contentTypeNames[9]{"sigpatches", "cheats", "firmwares", "app", "bootloaders", "cfws", "payloads", "hekate_ipl", "firmwares_mega"};
enum class CFW
{

View file

@ -87,6 +87,7 @@ void ListDownloadTab::createList(contentType type)
std::string doneMsg = "menus/common/all_done"_i18n;
switch (type) {
case contentType::megafw:
case contentType::fw: {
std::string contentsPath = util::getContentsPath();
for (const auto& tid : {"0100000000001000", "0100000000001007", "0100000000001013"}) {
@ -144,6 +145,7 @@ void ListDownloadTab::setDescription(contentType type)
case contentType::sigpatches:
description->setText("menus/main/sigpatches_text"_i18n);
break;
case contentType::megafw:
case contentType::fw: {
SetSysFirmwareVersion ver;
description->setText(fmt::format("{}{}", "menus/main/firmware_text"_i18n, R_SUCCEEDED(setsysGetFirmwareVersion(&ver)) ? ver.display_version : "menus/main/not_found"_i18n));

View file

@ -50,7 +50,7 @@ MainFrame::MainFrame() : TabFrame()
this->addTab("menus/main/update_sigpatches"_i18n, new ListDownloadTab(contentType::sigpatches, nxlinks));
if (!util::getBoolValue(hideStatus, "firmwares"))
this->addTab("menus/main/download_firmware"_i18n, new ListDownloadTab(contentType::fw, nxlinks));
this->addTab("menus/main/download_firmware"_i18n, new ListDownloadTab(contentType::megafw, nxlinks));
if (!util::getBoolValue(hideStatus, "cheats"))
this->addTab("menus/main/download_cheats"_i18n, new ListDownloadTab(contentType::cheats));

View file

@ -49,6 +49,7 @@ namespace util {
case contentType::cheats:
status_code = download::downloadFile(url, CHEATS_FILENAME, OFF);
break;
case contentType::megafw:
case contentType::fw:
status_code = download::downloadFile(url, FIRMWARE_FILENAME, OFF);
break;
@ -132,6 +133,7 @@ namespace util {
case contentType::cheats:
filename = CHEATS_FILENAME;
break;
case contentType::megafw:
case contentType::fw:
filename = FIRMWARE_FILENAME;
break;
@ -166,6 +168,7 @@ namespace util {
extract::extractCheats(CHEATS_FILENAME, titles, CurrentCfw::running_cfw, version);
break;
}
case contentType::megafw:
case contentType::fw:
if (std::filesystem::exists(FIRMWARE_PATH)) std::filesystem::remove_all(FIRMWARE_PATH);
fs::createTree(FIRMWARE_PATH);