mirror of https://github.com/Xhofe/alist
chore: change qBittorrent setting [skip ci]
parent
805b1e4fa3
commit
ae2ee1821a
|
@ -156,7 +156,7 @@ func InitialSettings() []model.SettingItem {
|
|||
{Key: conf.GithubLoginEnabled, Value: "false", Type: conf.TypeBool, Group: model.GITHUB, Flag: model.PUBLIC},
|
||||
|
||||
// qbittorrent settings
|
||||
{Key: conf.QbittorrentUrl, Value: "http://admin:adminadmin@localhost:8080/", Type: conf.TypeString, Group: model.QBITTORRENT, Flag: model.PRIVATE},
|
||||
{Key: conf.QbittorrentUrl, Value: "http://admin:adminadmin@localhost:8080/", Type: conf.TypeString, Group: model.SINGLE, Flag: model.PRIVATE},
|
||||
}
|
||||
if flags.Dev {
|
||||
initialSettingItems = append(initialSettingItems, []model.SettingItem{
|
||||
|
|
|
@ -9,7 +9,6 @@ const (
|
|||
ARIA2
|
||||
INDEX
|
||||
GITHUB
|
||||
QBITTORRENT
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue