From 22665aa19adb47cd99527ae60ac683bdf40077ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=AE=E5=87=89?= <927625802@qq.com> Date: Mon, 20 Dec 2021 17:24:49 +0800 Subject: [PATCH] :art: move default text types --- bootstrap/setting.go | 3 ++- conf/var.go | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bootstrap/setting.go b/bootstrap/setting.go index acf71c22..751c8309 100644 --- a/bootstrap/setting.go +++ b/bootstrap/setting.go @@ -5,6 +5,7 @@ import ( "github.com/Xhofe/alist/model" log "github.com/sirupsen/logrus" "gorm.io/gorm" + "strings" ) func InitSettings() { @@ -61,7 +62,7 @@ func InitSettings() { }, { Key: "text types", - Value: "txt,htm,html,xml,java,properties,sql,js,md,json,conf,ini,vue,php,py,bat,gitignore,yml,go,sh,c,cpp,h,hpp,tsx,vtt,srt,ass", + Value: strings.Join(conf.TextTypes, ","), Type: "string", Description: "text type extensions", }, diff --git a/conf/var.go b/conf/var.go index e464c050..f29910fa 100644 --- a/conf/var.go +++ b/conf/var.go @@ -29,7 +29,9 @@ var ( ) var ( - TextTypes = []string{"txt", "go", "md"} + TextTypes = []string{"txt", "htm", "html", "xml", "java", "properties", "sql", + "js", "md", "json", "conf", "ini", "vue", "php", "py", "bat", "gitignore", "yml", + "go", "sh", "c", "cpp", "h", "hpp", "tsx", "vtt", "srt", "ass"} OfficeTypes = []string{"doc", "docx", "xls", "xlsx", "ppt", "pptx", "pdf"} VideoTypes = []string{"mp4", "mkv", "avi", "mov", "rmvb", "webm"} AudioTypes = []string{"mp3", "flac", "ogg", "m4a"}