style: rename accessors to idiomatic names

This commit is contained in:
Mathis Maquenne
2026-08-05 11:47:53 +02:00
parent 88319ebb3c
commit f8b301e24c
16 changed files with 46 additions and 46 deletions
+4 -4
View File
@@ -20,11 +20,11 @@ type Playlist struct {
} `json:"results"`
}
func (p *Playlist) GetTitle() string {
func (p *Playlist) Title() string {
return p.Results.Data.Title
}
func (p *Playlist) GetTracks() []*Track {
func (p *Playlist) Tracks() []*Track {
return p.Results.Tracks.Data
}
@@ -32,11 +32,11 @@ func (p *Playlist) SetTracks(t []*Track) {
p.Results.Tracks.Data = t
}
func (p *Playlist) GetOutputDir(outputDir string) string {
func (p *Playlist) OutputDir(outputDir string) string {
base, _ := filenamify.Filenamify(p.Results.Data.Title, filenamify.Options{})
return path.Join(outputDir, base)
}
func (p *Playlist) Unmarshal(data []byte) error {
func (p *Playlist) decode(data []byte) error {
return json.Unmarshal(data, p)
}