fix: resolve bugs found in pre-release review

This commit is contained in:
Mathis Maquenne
2026-08-05 21:33:08 +02:00
parent 5bb1448650
commit a695fb4de3
17 changed files with 258 additions and 60 deletions
+7 -1
View File
@@ -2,6 +2,7 @@ package deezer
import (
"context"
"errors"
"fmt"
)
@@ -12,9 +13,14 @@ func resolveARL(ctx context.Context, validate func(ctx context.Context, arl stri
}
if creds != nil && creds.ARL != "" {
if verr := validate(ctx, creds.ARL); verr == nil {
verr := validate(ctx, creds.ARL)
if verr == nil {
return creds.ARL, nil
}
if !errors.Is(verr, ErrInvalidARL) {
return "", fmt.Errorf("stored session could not be validated: %w", verr)
}
}
if creds != nil && creds.Email != "" && creds.Password != "" {