chore: change qBittorrent setting [skip ci]

This commit is contained in:
Andy Hsu
2023-02-15 16:24:03 +08:00
parent 805b1e4fa3
commit ae2ee1821a
4 changed files with 9 additions and 6 deletions

View File

@ -19,10 +19,14 @@ func SetQbittorrent(c *gin.Context) {
common.ErrorResp(c, err, 400)
return
}
items := []model.SettingItem{
{Key: conf.QbittorrentUrl, Value: req.Url, Type: conf.TypeString, Group: model.QBITTORRENT, Flag: model.PRIVATE},
item := &model.SettingItem{
Key: conf.QbittorrentUrl,
Value: req.Url,
Type: conf.TypeString,
Group: model.SINGLE,
Flag: model.PRIVATE,
}
if err := op.SaveSettingItems(items); err != nil {
if err := op.SaveSettingItem(item); err != nil {
common.ErrorResp(c, err, 500)
return
}

View File

@ -89,7 +89,7 @@ func admin(g *gin.RouterGroup) {
setting.POST("/delete", handles.DeleteSetting)
setting.POST("/reset_token", handles.ResetToken)
setting.POST("/set_aria2", handles.SetAria2)
setting.POST("/set_qbittorrent", handles.SetQbittorrent)
setting.POST("/set_qbit", handles.SetQbittorrent)
task := g.Group("/task")
handles.SetupTaskRoute(task)