瀏覽代碼

准备新增 API KEY 功能

Signed-off-by: allan716 <[email protected]>
allan716 3 年之前
父節點
當前提交
a429bf96c3

+ 10 - 0
internal/pkg/settings/api_key_settings.go

@@ -0,0 +1,10 @@
+package settings
+
+type ApiKeySettings struct {
+	Enabled bool   `json:"enabled"`
+	Key     string `json:"key"`
+}
+
+func NewApiKeySettings(enabled bool, key string) *ApiKeySettings {
+	return &ApiKeySettings{Enabled: enabled, Key: key}
+}

+ 1 - 0
internal/pkg/settings/experimental_function.go

@@ -5,6 +5,7 @@ type ExperimentalFunction struct {
 	AutoChangeSubEncode  AutoChangeSubEncode  `json:"auto_change_sub_encode"`
 	ChsChtChanger        ChsChtChanger        `json:"chs_cht_changer"`
 	RemoteChromeSettings RemoteChromeSettings `json:"remote_chrome_settings"`
+	ApiKeySettings       ApiKeySettings       `json:"api_key_settings"`
 }
 
 func NewExperimentalFunction() *ExperimentalFunction {

+ 3 - 0
internal/types/task_queue/job_status.go

@@ -8,6 +8,7 @@ const (
 	Failed                       // 任务失败了,在允许的范围内依然会允许重试
 	Done                         // 任务完成
 	Downloading                  // 任务正在下载
+	Ignore                       // 任务被忽略,会存在于任务列表,但是不下载
 )
 
 func (c JobStatus) String() string {
@@ -22,6 +23,8 @@ func (c JobStatus) String() string {
 		return "done"
 	case Downloading:
 		return "downloading"
+	case Ignore:
+		return "ignore"
 	}
 	return "N/A"
 }