feat: add wav download quality
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user