package ytdlp import ( "context" "fmt" "git.kmsign.ru/royalcat/tstor/src/tasks" ) const executorName = "ytdlp" type DownloadTask struct { Name string } var _ tasks.Task = (*DownloadTask)(nil) // Executor implements tasks.Task. func (d *DownloadTask) Executor() string { return executorName } var _ tasks.TaskExecutor = (*Daemon)(nil) // ExecutorName implements tasks.TaskExecutor. func (c *Daemon) ExecutorName() string { return executorName } func (c *Daemon) RunTask(ctx context.Context, upd tasks.Updater, task tasks.Task) error { switch t := task.(type) { case *DownloadTask: return c.controllers[t.Name].Update(ctx, upd) default: return fmt.Errorf("unknown task type: %T", task) } }