fix: use filepath helpers for filesystem paths
This commit is contained in:
@@ -3,7 +3,7 @@ package deezer
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"path"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/flytam/filenamify"
|
||||
)
|
||||
@@ -41,7 +41,7 @@ func (a *Album) SetTracks(t []*Track) {
|
||||
func (a *Album) OutputDir(outputDir string) string {
|
||||
base := fmt.Sprintf("%s - %s", a.Results.Data.Artist, a.Results.Data.Title)
|
||||
base, _ = filenamify.Filenamify(base, filenamify.Options{})
|
||||
return path.Join(outputDir, base)
|
||||
return filepath.Join(outputDir, base)
|
||||
}
|
||||
|
||||
func (a *Album) decode(data []byte) error {
|
||||
|
||||
@@ -2,7 +2,7 @@ package deezer
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"path"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/flytam/filenamify"
|
||||
)
|
||||
@@ -32,7 +32,7 @@ func (a *Artist) SetTracks(t []*Track) {
|
||||
|
||||
func (a *Artist) OutputDir(outputDir string) string {
|
||||
base, _ := filenamify.Filenamify(a.Results.Data.Name, filenamify.Options{})
|
||||
return path.Join(outputDir, base)
|
||||
return filepath.Join(outputDir, base)
|
||||
}
|
||||
|
||||
func (a *Artist) decode(data []byte) error {
|
||||
|
||||
@@ -2,7 +2,7 @@ package deezer
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"path"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/flytam/filenamify"
|
||||
)
|
||||
@@ -34,7 +34,7 @@ func (p *Playlist) SetTracks(t []*Track) {
|
||||
|
||||
func (p *Playlist) OutputDir(outputDir string) string {
|
||||
base, _ := filenamify.Filenamify(p.Results.Data.Title, filenamify.Options{})
|
||||
return path.Join(outputDir, base)
|
||||
return filepath.Join(outputDir, base)
|
||||
}
|
||||
|
||||
func (p *Playlist) decode(data []byte) error {
|
||||
|
||||
@@ -2,7 +2,7 @@ package deezer
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"path"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
type Single struct {
|
||||
@@ -28,7 +28,7 @@ func (s *Single) Tracks() []*Track {
|
||||
func (s *Single) SetTracks(tracks []*Track) {}
|
||||
|
||||
func (s *Single) OutputDir(outputDir string) string {
|
||||
return path.Join(outputDir, "Singles")
|
||||
return filepath.Join(outputDir, "Singles")
|
||||
}
|
||||
|
||||
func (s *Single) decode(data []byte) error {
|
||||
|
||||
Reference in New Issue
Block a user