Add DefaultOptions

master v0.0.15
Stein Ivar Berghei 2024-04-16 10:17:29 +02:00
parent 7b4bf1563c
commit c4f1163a94
1 changed files with 3 additions and 1 deletions

View File

@ -15,6 +15,7 @@ type GuessitConfig struct {
type Guessit struct { type Guessit struct {
GuessitConfig GuessitConfig
DefaultOptions []string
} }
type Match struct { type Match struct {
@ -105,11 +106,12 @@ func New(conf GuessitConfig) (Guessit, error) {
} }
} }
return Guessit{conf}, nil return Guessit{conf, []string{}}, nil
} }
func (g Guessit) Guessit(s string, options ...string) (out Match, err error) { func (g Guessit) Guessit(s string, options ...string) (out Match, err error) {
args := []string{"-m", "guessit", s} args := []string{"-m", "guessit", s}
args = append(args, g.DefaultOptions...)
args = append(args, options...) args = append(args, options...)
args = append(args, "--json") args = append(args, "--json")