fix: replace forbidden chars in output file name

This commit is contained in:
Mathis Maquenne
2024-10-14 16:22:44 +02:00
parent f247a0f71e
commit d38a2c4f7b
5 changed files with 23 additions and 3 deletions
+7 -1
View File
@@ -3,6 +3,8 @@ package deezer
import (
"encoding/json"
"path"
"github.com/flytam/filenamify"
)
type Playlist struct {
@@ -27,7 +29,11 @@ func (p *Playlist) GetSongs() []*Song {
}
func (p *Playlist) GetOutputPath(outputDir string) string {
return path.Join(outputDir, p.Data.Title)
p.Data.Title, _ = filenamify.Filenamify(p.Data.Title, filenamify.Options{})
outputPath := path.Join(outputDir, p.Data.Title)
outputPath, _ = filenamify.Filenamify(outputPath, filenamify.Options{})
return outputPath
}
func (p *Playlist) GetTitle() string {