task_queue

package
v0.55.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JobStatus

type JobStatus int
const (
	Waiting     JobStatus = iota // 任务正在等待处理
	Committed                    // 任务已经提交,这个可能是提交给服务器,然后等待查询下载 Local 的本地任务不会使用这个标注位
	Failed                       // 任务失败了,在允许的范围内依然会允许重试
	Done                         // 任务完成
	Downloading                  // 任务正在下载
	Ignore                       // 任务被忽略,会存在于任务列表,但是不下载
)

func (JobStatus) String

func (c JobStatus) String() string

type OneJob

type OneJob struct {
	Id                       string           `json:"id"`                           // 任务的唯一 ID
	VideoType                common.VideoType `json:"video_type"`                   // 视频的类型
	VideoFPath               string           `json:"video_f_path"`                 // 视频的全路径
	VideoName                string           `json:"video_name"`                   // 视频的名称
	Feature                  string           `json:"feature"`                      // 视频的特征码,蓝光的时候可能是空
	SeriesRootDirPath        string           `json:"series_root_dir_path"`         // 连续剧的目录
	Season                   int              `json:"season"`                       // 如果对应的是电影则可能是 0,没有
	Episode                  int              `json:"episode"`                      // 如果对应的是电影则可能是 0,没有
	JobStatus                JobStatus        `json:"job_status"`                   // 任务的状态
	TaskPriority             int              `json:"task_priority" default:"5"`    // 任务的优先级,0 - 10 个级别,0 是最高,10 是最低
	RetryTimes               int              `json:"retry_times"`                  // 重试了多少次
	CreatedTime              emby.Time        `json:"created_time"`                 // 视频的发布时间或者是文件的创建时间
	AddedTime                emby.Time        `json:"added_time"`                   // 任务添加的时间
	UpdateTime               emby.Time        `json:"update_time"`                  // 任务更新的时间
	MediaServerInsideVideoID string           `json:"media_server_inside_video_id"` // 媒体服务器中,这个视频的 ID,如果是 Emby 就对应它内部这个视频的 ID,后续用于指定刷新视频信息
	ErrorInfo                string           `json:"error_info"`                   // 这个任务的错误信息
	DownloadTimes            int              `json:"download_times"`               // 下载的次数,用于统计下载过几次
}

func NewOneJob

func NewOneJob(videoType common.VideoType, videoFPath string, taskPriority int, MediaServerInsideVideoID ...string) *OneJob

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL