common_settings.go 1.1 KB

123456789101112131415161718192021
  1. package settings
  2. type CommonSettings struct {
  3. IntervalOrAssignOrCustom int `json:"interval_or_assign_or_custom"` // 扫描时间是,使用间隔还是指定时间
  4. ScanInterval string `json:"scan_interval"` // 一轮字幕扫描的间隔
  5. Threads int `json:"threads"` // 同时扫描的并发数
  6. RunScanAtStartUp bool `json:"run_scan_at_start_up"` // 完成引导设置后,下次运行程序就开始扫描
  7. MoviePaths []string `json:"movie_paths"` // 电影的目录
  8. SeriesPaths []string `json:"series_paths"` // 连续剧的目录
  9. }
  10. func NewCommonSettings() *CommonSettings {
  11. return &CommonSettings{
  12. IntervalOrAssignOrCustom: 0,
  13. ScanInterval: "@every 6h", // 间隔 6h 进行字幕的扫描 https://pkg.go.dev/github.com/robfig/cron/v3
  14. Threads: 1,
  15. RunScanAtStartUp: true,
  16. MoviePaths: make([]string, 0),
  17. SeriesPaths: make([]string, 0),
  18. }
  19. }