advanced_settings.go 2.6 KB

123456789101112131415161718192021222324252627282930313233343536
  1. package settings
  2. import (
  3. "github.com/ChineseSubFinder/ChineseSubFinder/pkg/local_http_proxy_server"
  4. "github.com/ChineseSubFinder/ChineseSubFinder/pkg/types/common"
  5. )
  6. type AdvancedSettings struct {
  7. ProxySettings *ProxySettings `json:"proxy_settings"`
  8. TmdbApiSettings TmdbApiSettings `json:"tmdb_api_settings"`
  9. DebugMode bool `json:"debug_mode"` // 是否开启调试模式,这个是写入一个特殊的文件来开启日志的 Debug 输出
  10. SaveFullSeasonTmpSubtitles bool `json:"save_full_season_tmp_subtitles"` // 保存整季的缓存字幕
  11. SubTypePriority int `json:"sub_type_priority"` // 字幕下载的优先级,0 是自动,1 是 srt 优先,2 是 ass/ssa 优先
  12. SubNameFormatter int `json:"sub_name_formatter"` // 字幕命名格式(默认不填写或者超出范围,则为 emby 格式),0,emby 支持的的格式(AAA.chinese(简英,subhd).ass or AAA.chinese(简英,xunlei).default.ass),1常规格式(兼容性更好,AAA.zh.ass or AAA.zh.default.ass)
  13. SaveMultiSub bool `json:"save_multi_sub"` // 保存多个网站的 Top 1 字幕
  14. CustomVideoExts []string `json:"custom_video_exts"` // 自定义视频扩展名,是在原有基础上新增。
  15. FixTimeLine bool `json:"fix_time_line"` // 开启校正字幕时间轴,默认 false
  16. Topic int `json:"topic"` // 搜索结果的时候,返回 Topic N 以内的
  17. SuppliersSettings *SuppliersSettings `json:"suppliers_settings"` // 每个字幕源的设置
  18. ScanLogic *ScanLogic `json:"scan_logic"` // 扫描的逻辑
  19. TaskQueue *TaskQueue `json:"task_queue"` // 任务队列的设置
  20. DownloadFileCache *DownloadFileCache `json:"download_file_cache"` // 下载文件的缓存
  21. }
  22. func NewAdvancedSettings() *AdvancedSettings {
  23. return &AdvancedSettings{
  24. ProxySettings: NewProxySettings(false, "http", local_http_proxy_server.LocalHttpProxyPort, "127.0.0.1", "10809", "", ""),
  25. TmdbApiSettings: *NewTmdbApiSettings(false, "", false),
  26. CustomVideoExts: make([]string, 0),
  27. Topic: common.DownloadSubsPerSite,
  28. SuppliersSettings: NewSuppliersSettings(),
  29. ScanLogic: NewScanLogic(false, false),
  30. TaskQueue: NewTaskQueue(),
  31. DownloadFileCache: NewDownloadFileCache(),
  32. }
  33. }