Update db.json Favorites
-
I'm referring to the db.json file located in the UserPresets folder inside each expansion.
-
In HISE: When I save a favorite preset from an expansion, the db.json file is not updated immediately. It only gets updated after saving the XML file.
-
In the plugin: The db.json file is not updated after saving a favorite preset. So the favorites are lost after closing the plugin or changing the expansion.
How can I update the db.json file immediately after marking a preset as a favorite?
-
-
This post is deleted! -
@bendurso Or I've already figured out the problem. The database is saved when the plugin is closed.
So if the user decides to change the expansion, he lose their saved favorites.
Is there an API to save the database?
-
@bendurso Actually, you could modify the source code to save the database before changing the expansion:
Just like this:
void PresetBrowser::expansionPackLoaded(Expansion* currentExpansion) { if (rootFile.isDirectory()) savePresetDatabase(rootFile); refreshColumnUpdatesAfterExpansionSwitch = true; if(currentExpansion != nullptr) selectionChanged(-1, -1, currentExpansion->getRootFolder(), false); else selectionChanged(-1, -1, File(), false); }
It works :)
-
@bendurso I like that you're giving yourself help now :)
-
@d-healey I'm starting to think like you :) hehe
I think this change should be also submited to the hise code right?
-
@bendurso If it doesn't break anything else then why not