Enhance configuration handling and implement wizard completion logic
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -761,6 +761,10 @@ func saveWizard(request RequestStruct) (nextStep int, err error) {
|
||||
|
||||
}
|
||||
|
||||
if nextStep == 10 {
|
||||
Settings.WizardCompleted = true
|
||||
}
|
||||
|
||||
err = saveSettings(Settings)
|
||||
if err != nil {
|
||||
return
|
||||
|
||||
@@ -302,6 +302,7 @@ type SettingsStruct struct {
|
||||
Version string `json:"version"`
|
||||
XepgReplaceMissingImages bool `json:"xepg.replace.missing.images"`
|
||||
XteveAutoUpdate bool `json:"xteveAutoUpdate"`
|
||||
WizardCompleted bool `json:"wizard.completed"`
|
||||
}
|
||||
|
||||
// LanguageUI : Sprache für das WebUI
|
||||
|
||||
@@ -97,6 +97,8 @@ func loadSettings() (settings SettingsStruct, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
var freshInstall = len(settingsMap) == 0
|
||||
|
||||
// Deafult Werte setzten
|
||||
var defaults = make(map[string]any)
|
||||
var dataMap = make(map[string]any)
|
||||
@@ -150,6 +152,7 @@ func loadSettings() (settings SettingsStruct, err error) {
|
||||
defaults["udpxy"] = ""
|
||||
defaults["version"] = System.DBVersion
|
||||
defaults["xteveAutoUpdate"] = true
|
||||
defaults["wizard.completed"] = !freshInstall
|
||||
var defaultTempPath = System.Folder.Temp
|
||||
if len(os.Getenv("XTEVE_CONFIG")) > 0 {
|
||||
defaultTempPath = System.Folder.Config + "tmp" + string(os.PathSeparator)
|
||||
|
||||
+1
-1
@@ -637,7 +637,7 @@ func Web(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
if System.ScanInProgress == 0 {
|
||||
|
||||
if len(Settings.Files.M3U) == 0 && len(Settings.Files.HDHR) == 0 {
|
||||
if Settings.WizardCompleted == false && len(Settings.Files.M3U) == 0 && len(Settings.Files.HDHR) == 0 {
|
||||
System.ConfigurationWizard = true
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user