Adds update checker with user preference

Introduces an update checker feature that respects the user's preference, allowing them to enable or disable automatic update checks.

The setting is persisted in the config file and synced to the backend.

Also introduces a page dedicated to listing music that inspired the project, and makes some minor UI improvements
This commit is contained in:
Flavio Fois
2026-02-08 22:09:32 +01:00
parent 0cfe1b65f3
commit 5b62790248
9 changed files with 346 additions and 17 deletions

View File

@@ -98,3 +98,33 @@ func (a *App) ImportSettings() (string, error) {
return string(data), nil
}
// SetUpdateCheckerEnabled updates the UPDATE_CHECK_ENABLED setting in config.ini
// based on the user's preference from the GUI settings.
//
// Parameters:
// - enabled: true to enable update checking, false to disable
//
// Returns:
// - error: Error if loading or saving config fails
func (a *App) SetUpdateCheckerEnabled(enabled bool) error {
// Load current config
config := a.GetConfig()
if config == nil {
return fmt.Errorf("failed to load config")
}
// Update the setting
if enabled {
config.EMLy.UpdateCheckEnabled = "true"
} else {
config.EMLy.UpdateCheckEnabled = "false"
}
// Save config back to disk
if err := a.SaveConfig(config); err != nil {
return fmt.Errorf("failed to save config: %w", err)
}
return nil
}