move ffmpeg command to seperate table

This commit is contained in:
Samuel Lorch 2024-06-23 22:47:50 +02:00
parent 72dfd2408f
commit cdeb266e38
20 changed files with 245 additions and 84 deletions

View file

@ -20,12 +20,12 @@ func RunHealthCheck(conf config.Config, t *types.Task, data types.HealthCheckDat
path := filepath.Join(conf.Worker.TempDir, fmt.Sprintf("%v-%v.mkv", t.ID, t.FileID))
// Set ffmpeg input path
if len(data.Command.InputFiles) == 0 {
l.ErrorContext(ctx, "FFmpeg Command has no input files")
if len(t.FfmpegCommand.InputFiles) == 0 {
l.ErrorContext(ctx, "FFmpeg Command has no input files", "command", t.FfmpegCommand)
return
}
data.Command.InputFiles[0].Path = path
t.FfmpegCommand.InputFiles[0].Path = path
// TODO cleanup file when done
defer func() {
@ -43,7 +43,7 @@ func RunHealthCheck(conf config.Config, t *types.Task, data types.HealthCheckDat
return
}
err = runFfmpegCommand(ctx, l, conf, data.Command)
err = runFfmpegCommand(ctx, l, conf, t.FfmpegCommand)
if err != nil {
l.ErrorContext(ctx, "FFmpeg Failed", "err", err)
return