advanced_settings.go 2.5 KB

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