MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / SaveSettingItems

Function SaveSettingItems

internal/op/setting.go:153–170  ·  view source on GitHub ↗
(items []model.SettingItem)

Source from the content-addressed store, hash-verified

151}
152
153func SaveSettingItems(items []model.SettingItem) error {
154 for i := range items {
155 item := &items[i]
156 if it, ok := MigrationSettingItems[item.Key]; ok &&
157 item.Value == it.MigrationValue {
158 item.Value = it.Value
159 }
160 if ok, err := HandleSettingItemHook(item); ok && err != nil {
161 return fmt.Errorf("failed to execute hook on %s: %+v", item.Key, err)
162 }
163 }
164 err := db.SaveSettingItems(items)
165 if err != nil {
166 return fmt.Errorf("failed save setting: %+v", err)
167 }
168 SettingCacheUpdate()
169 return nil
170}
171
172func SaveSettingItem(item *model.SettingItem) (err error) {
173 if it, ok := MigrationSettingItems[item.Key]; ok &&

Callers 12

SetAria2Function · 0.92
SetQbittorrentFunction · 0.92
SetTransmissionFunction · 0.92
Set115Function · 0.92
Set115OpenFunction · 0.92
Set123PanFunction · 0.92
Set123OpenFunction · 0.92
SetPikPakFunction · 0.92
SetThunderFunction · 0.92
SetThunderXFunction · 0.92
SetThunderBrowserFunction · 0.92
SaveSettingsFunction · 0.92

Calls 3

SaveSettingItemsFunction · 0.92
HandleSettingItemHookFunction · 0.85
SettingCacheUpdateFunction · 0.85

Tested by

no test coverage detected