()
| 125 | } |
| 126 | |
| 127 | func (s *Settings) Save() error { |
| 128 | |
| 129 | // 需要检查 url 是否正确 |
| 130 | newEmbyAddressUrl := removeSuffixAddressSlash(s.EmbySettings.AddressUrl) |
| 131 | _, err := url.Parse(newEmbyAddressUrl) |
| 132 | if err != nil { |
| 133 | return err |
| 134 | } |
| 135 | s.EmbySettings.AddressUrl = newEmbyAddressUrl |
| 136 | |
| 137 | return strcut_json.ToFile(s.configFPath, s) |
| 138 | } |
| 139 | |
| 140 | func (s *Settings) GetNoPasswordSettings() *Settings { |
| 141 |
no test coverage detected