Skip to content

Commit a5b757b

Browse files
committed
feat: customize audio/video types (close AlistGo#819)
1 parent 0bc05a6 commit a5b757b

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

bootstrap/setting.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,20 @@ func InitSettings() {
7373
Description: "text type extensions",
7474
Group: model.FRONT,
7575
},
76+
{
77+
Key: "audio types",
78+
Value: strings.Join(conf.AudioTypes, ","),
79+
Type: "string",
80+
Description: "audio type extensions",
81+
Group: model.FRONT,
82+
},
83+
{
84+
Key: "video types",
85+
Value: strings.Join(conf.VideoTypes, ","),
86+
Type: "string",
87+
Description: "video type extensions",
88+
Group: model.FRONT,
89+
},
7690
{
7791
Key: "d_proxy types",
7892
Value: strings.Join(conf.DProxyTypes, ","),

model/setting.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,14 @@ func LoadSettings() {
9393
if err == nil {
9494
conf.TextTypes = strings.Split(textTypes.Value, ",")
9595
}
96+
audioTypes, err := GetSettingByKey("text types")
97+
if err == nil {
98+
conf.AudioTypes = strings.Split(audioTypes.Value, ",")
99+
}
100+
videoTypes, err := GetSettingByKey("text types")
101+
if err == nil {
102+
conf.VideoTypes = strings.Split(videoTypes.Value, ",")
103+
}
96104
dProxyTypes, err := GetSettingByKey("d_proxy types")
97105
if err == nil {
98106
conf.DProxyTypes = strings.Split(dProxyTypes.Value, ",")

0 commit comments

Comments
 (0)