themezer: only show latest release for nxtheme when prompting user to download nro.

This commit is contained in:
ITotalJustice
2025-08-03 04:00:21 +01:00
parent 4300c9ee1b
commit 9fe9c9d491
3 changed files with 6 additions and 5 deletions

View File

@@ -79,14 +79,14 @@ private:
void DownloadEntries(const Entry& entry); void DownloadEntries(const Entry& entry);
// parses the params into entry struct and calls DonwloadEntries // parses the params into entry struct and calls DonwloadEntries
bool Download(const std::string& url, const std::vector<AssetEntry>& assets = {}, const std::string& pre_install_message = {}, const std::string& post_install_message = {}); bool Download(const std::string& url, const std::vector<AssetEntry>& assets = {}, const std::string& tag = {}, const std::string& pre_install_message = {}, const std::string& post_install_message = {});
// calls the above function by pushing the asset to an array. // calls the above function by pushing the asset to an array.
inline bool Download(const std::string& url, const AssetEntry& asset, const std::string& pre_install_message = {}, const std::string& post_install_message = {}) { inline bool Download(const std::string& url, const AssetEntry& asset, const std::string& tag = {}, const std::string& pre_install_message = {}, const std::string& post_install_message = {}) {
std::vector<AssetEntry> assets; std::vector<AssetEntry> assets;
assets.emplace_back(asset); assets.emplace_back(asset);
return Download(url, assets, pre_install_message, post_install_message); return Download(url, assets, tag, pre_install_message, post_install_message);
} }
} // namespace sphaira::ui::menu::gh } // namespace sphaira::ui::menu::gh

View File

@@ -460,9 +460,10 @@ void DownloadEntries(const Entry& entry) {
}); });
} }
bool Download(const std::string& url, const std::vector<AssetEntry>& assets, const std::string& pre_install_message, const std::string& post_install_message) { bool Download(const std::string& url, const std::vector<AssetEntry>& assets, const std::string& tag, const std::string& pre_install_message, const std::string& post_install_message) {
Entry entry{}; Entry entry{};
entry.url = url; entry.url = url;
entry.tag = tag;
entry.assets = assets; entry.assets = assets;
entry.pre_install_message = pre_install_message; entry.pre_install_message = pre_install_message;
entry.post_install_message = post_install_message; entry.post_install_message = post_install_message;

View File

@@ -580,7 +580,7 @@ void Menu::OnFocusGained() {
.path = "/switch/Switch_themes_Installer/NXThemesInstaller.nro", .path = "/switch/Switch_themes_Installer/NXThemesInstaller.nro",
}; };
gh::Download(NRO_URL, asset); gh::Download(NRO_URL, asset, "latest");
} }
} }
); );