refactor: rework output directory handling

This commit is contained in:
Mathis Maquenne
2025-05-19 15:38:18 +02:00
parent 674eb99ffd
commit 68f22ce571
8 changed files with 76 additions and 111 deletions
+4 -13
View File
@@ -13,21 +13,12 @@ var validQualities = map[string]bool{
}
type Options struct {
OutputDir string
Quality string
Timeout time.Duration
BPM bool
Quality string
Timeout time.Duration
BPM bool
}
func (o *Options) Validate(appDir string) error {
if o.OutputDir == "" {
o.OutputDir = appDir
}
if o.Quality == "" {
o.Quality = "best"
}
func (o *Options) Validate() error {
if !validQualities[o.Quality] {
return fmt.Errorf("invalid quality option: %s", o.Quality)
}