Răsfoiți Sursa

修复,读取配置文件的bug

Signed-off-by: allan716 <[email protected]>
allan716 3 ani în urmă
părinte
comite
858a48ea6a
1 a modificat fișierele cu 4 adăugiri și 4 ștergeri
  1. 4 4
      pkg/settings/settings.go

+ 4 - 4
pkg/settings/settings.go

@@ -107,13 +107,13 @@ func NewSettings(configRootDirFPath string) *Settings {
 
 func (s *Settings) read() error {
 
-	// 需要检查 url 是否正确
-	newEmbyAddressUrl := removeSuffixAddressSlash(s.EmbySettings.AddressUrl)
-	_, err := url.Parse(newEmbyAddressUrl)
+	err := strcut_json.ToStruct(s.configFPath, s)
 	if err != nil {
 		return err
 	}
-	err = strcut_json.ToStruct(s.configFPath, s)
+	// 需要检查 url 是否正确
+	newEmbyAddressUrl := removeSuffixAddressSlash(s.EmbySettings.AddressUrl)
+	_, err = url.Parse(newEmbyAddressUrl)
 	if err != nil {
 		return err
 	}