refactor: move resource info rendering into downloader

This commit is contained in:
Mathis Maquenne
2026-08-05 11:41:24 +02:00
parent dbd7837b17
commit 12dbbb5e10
6 changed files with 112 additions and 98 deletions
-17
View File
@@ -2,9 +2,7 @@ package deezer
import (
"encoding/json"
"fmt"
"path"
"time"
"github.com/flytam/filenamify"
)
@@ -22,21 +20,6 @@ type Playlist struct {
} `json:"results"`
}
func (p *Playlist) String() string {
return fmt.Sprintf(
`=============== [ Playlist Info ] ===============
Title: %s
Creator: %s
Tracks: %d
Duration: %s
=================================================`,
p.Results.Data.Title,
p.Results.Data.Creator,
len(p.Results.Tracks.Data),
time.Duration(p.Results.Data.Duration)*time.Second,
)
}
func (p *Playlist) GetTitle() string {
return p.Results.Data.Title
}