Skip to content

Commit

Permalink
fix: downloading sfh songs (and bump version to 0.3.2)
Browse files Browse the repository at this point in the history
  • Loading branch information
FlafyDev committed Sep 8, 2024
1 parent 5271416 commit a5a7bd0
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## v0.3.2
###### 08-09-2024

- <cl>Fixed</c> being unable to download SFH songs


## v0.3.1
###### 16-08-2024

Expand Down
6 changes: 3 additions & 3 deletions mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"win": "2.206",
"android": "2.206"
},
"version": "0.3.1",
"version": "0.3.2",
"id": "flafy.autonong",
"name": "Auto Nong",
"developer": "Flafy",
Expand Down Expand Up @@ -51,13 +51,13 @@
"type": "file",
"default": "yt-dlp.exe"
},
"indexes": {
"indexes2": {
"name": "Indexes",
"description": "Auto Nong indexes.\nFrom indexes the mod knows where to fetch the songs from.",
"type": "custom",
"default": [
"https://cdn.jsdelivr.net/gh/FlafyDev/auto-nong-indexes@dist/official.json.gz",
"https://cdn.jsdelivr.net/gh/FlafyDev/auto-nong-indexes@dist/sfh-rooot.json.gz"
"https://cdn.jsdelivr.net/gh/FlafyDev/auto-nong-indexes@dist/sfh.json.gz"
]
},
"show-level-popup": {
Expand Down
6 changes: 3 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

$on_mod(Loaded) {
Mod::get()->addCustomSetting<MultiStringSettingValue>(
"indexes", Mod::get()
->getSettingDefinition("indexes")
"indexes2", Mod::get()
->getSettingDefinition("indexes2")
->get<CustomSetting>()
->json->get<std::vector<std::string>>("default"));
Mod::get()->addCustomSetting<ANClearPPBlacklistSettingValue>("_blacklistPPClear", 0);
Expand All @@ -20,5 +20,5 @@

// Reload the indexes on change
listenForSettingChanges(
"indexes", +[](MultiStringSettingStruct value) { AutoNongManager::get()->loadIndexes(); });
"indexes2", +[](MultiStringSettingStruct value) { AutoNongManager::get()->loadIndexes(); });
}
2 changes: 1 addition & 1 deletion src/managers/auto_nong_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ void AutoNongManager::downloadSong(std::shared_ptr<ANSong> song, std::optional<i

void AutoNongManager::loadIndexes() {
std::vector<std::string> indexes =
Mod::get()->getSettingValue<MultiStringSettingStruct>("indexes").m_strings;
Mod::get()->getSettingValue<MultiStringSettingStruct>("indexes2").m_strings;

unloadAllIndexes();
loadLocalIndex();
Expand Down
2 changes: 1 addition & 1 deletion src/ui/multi_string_setting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ bool MultiStringSettingNode::init(MultiStringSettingValue *value, float width) {
menu->setID("inputs-menu");

// No way to get the JSON without hardcoding the setting ID...
auto settingJson = Mod::get()->getSettingDefinition("indexes")->get<CustomSetting>()->json;
auto settingJson = Mod::get()->getSettingDefinition("indexes2")->get<CustomSetting>()->json;
m_defaultValue = settingJson->get<std::vector<std::string>>("default");
m_name = settingJson->get<std::string>("name");
m_description = settingJson->get<std::string>("description");
Expand Down

0 comments on commit a5a7bd0

Please sign in to comment.