transcode entrypoint

main
bel 2025-12-02 16:28:55 -07:00
parent 81507319dd
commit 613bfdf96e
1 changed files with 13 additions and 0 deletions

View File

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