feat: add wav download quality

This commit is contained in:
Mathis Maquenne
2026-08-05 22:51:43 +02:00
parent b3777bf8eb
commit b804c5e288
8 changed files with 109 additions and 32 deletions
+12
View File
@@ -12,6 +12,7 @@ var validQualities = map[string]bool{
"mp3_128": true,
"mp3_320": true,
"flac": true,
"wav": true,
}
type Options struct {
@@ -23,6 +24,17 @@ type Options struct {
Strict bool
}
func (o *Options) sourceQuality() string {
if o.Quality == "wav" {
return "flac"
}
return o.Quality
}
func (o *Options) convertsToWAV() bool {
return o.Quality == "wav"
}
func (o *Options) Validate(kind deezer.Kind) error {
if !validQualities[o.Quality] {
return fmt.Errorf("invalid quality option: %s", o.Quality)