refactor: major project restructure

This commit is contained in:
Mathis Maquenne
2025-05-01 20:30:56 +02:00
parent c74531b36c
commit 0bae78a1ff
27 changed files with 1017 additions and 812 deletions
+7 -7
View File
@@ -28,22 +28,22 @@ func (a *Album) GetType() string {
return "Album"
}
func (a *Album) UnmarshalData(data []byte) error {
return json.Unmarshal(data, a)
func (a *Album) GetTitle() string {
return a.Results.Data.Title
}
func (a *Album) GetSongs() []*Song {
return a.Results.Songs.Data
}
func (a *Album) GetOutputPath(outputDir string) string {
func (a *Album) GetOutputDir(outputDir string) string {
base := fmt.Sprintf("%s - %s", a.Results.Data.Artist, a.Results.Data.Title)
base, _ = filenamify.Filenamify(base, filenamify.Options{})
outputPath := path.Join(outputDir, base)
outputDir = path.Join(outputDir, base)
return outputPath
return outputDir
}
func (a *Album) GetTitle() string {
return a.Results.Data.Title
func (a *Album) Unmarshal(data []byte) error {
return json.Unmarshal(data, a)
}