transcode entrypoint
parent
81507319dd
commit
613bfdf96e
|
|
@ -60,6 +60,13 @@ func Main(ctx context.Context, args []string) error {
|
|||
return fmt.Errorf("errors: %+v", errs)
|
||||
}
|
||||
return nil
|
||||
case Transcode:
|
||||
for _, pos := range flags.Pos {
|
||||
if err := inass.EntrypointTranscode(ctx, pos); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
default:
|
||||
panic(flags.Entrypoint.String())
|
||||
}
|
||||
|
|
@ -72,6 +79,7 @@ const (
|
|||
Defacto Entrypoint = iota
|
||||
DeportAss
|
||||
BestAssToSRT
|
||||
Transcode
|
||||
)
|
||||
|
||||
func (e *Entrypoint) Set(s string) error {
|
||||
|
|
@ -82,11 +90,14 @@ func (e *Entrypoint) Set(s string) error {
|
|||
*e = DeportAss
|
||||
case BestAssToSRT.String():
|
||||
*e = BestAssToSRT
|
||||
case Transcode.String():
|
||||
*e = Transcode
|
||||
default:
|
||||
return fmt.Errorf("%s nin (%s)", s, strings.Join([]string{
|
||||
Defacto.String(),
|
||||
DeportAss.String(),
|
||||
BestAssToSRT.String(),
|
||||
Transcode.String(),
|
||||
}, ", "))
|
||||
}
|
||||
return nil
|
||||
|
|
@ -100,6 +111,8 @@ func (e Entrypoint) String() string {
|
|||
return "deport-ass"
|
||||
case BestAssToSRT:
|
||||
return "best-ass-to-srt"
|
||||
case Transcode:
|
||||
return "transcode"
|
||||
}
|
||||
panic("cannot serialize entrypoint")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue