Add releaseDate attr to music struct
This commit is contained in:
parent
80b872d6e9
commit
0929e681ce
@ -102,8 +102,8 @@ func SearchAlbumByTitle(title string, album *Album) error {
|
|||||||
album.Artist = track["artists"].([]interface{})[0].(map[string]interface{})["name"].(string)
|
album.Artist = track["artists"].([]interface{})[0].(map[string]interface{})["name"].(string)
|
||||||
album.ID = albumData["id"].(string)
|
album.ID = albumData["id"].(string)
|
||||||
album.Album = albumData["name"].(string)
|
album.Album = albumData["name"].(string)
|
||||||
album.Date = albumData["release_date"].(string)
|
album.ReleaseDate = albumData["release_date"].(string)
|
||||||
album.Year, _ = strconv.Atoi(strings.Split(album.Date, "-")[0])
|
album.Year, _ = strconv.Atoi(strings.Split(album.ReleaseDate, "-")[0])
|
||||||
album.Subtitle = strconv.Itoa(album.Year)
|
album.Subtitle = strconv.Itoa(album.Year)
|
||||||
album.Tracks = int(albumData["total_tracks"].(float64)) // Spotify envía números como float64
|
album.Tracks = int(albumData["total_tracks"].(float64)) // Spotify envía números como float64
|
||||||
album.Link = albumData["href"].(string)
|
album.Link = albumData["href"].(string)
|
||||||
|
@ -99,6 +99,7 @@ func generateAlbumMarkdown(album Album) error {
|
|||||||
"Tracks": album.Tracks,
|
"Tracks": album.Tracks,
|
||||||
"Image": album.Image,
|
"Image": album.Image,
|
||||||
"Date": album.Date,
|
"Date": album.Date,
|
||||||
|
"ReleaseDate": album.ReleaseDate,
|
||||||
"Tags": "listening",
|
"Tags": "listening",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ type Album struct {
|
|||||||
Rate float64 `yaml:"rate"`
|
Rate float64 `yaml:"rate"`
|
||||||
Tracks int `yaml:"tracks"`
|
Tracks int `yaml:"tracks"`
|
||||||
Image string `yaml:"image"`
|
Image string `yaml:"image"`
|
||||||
|
ReleaseDate string `yaml:"release_date"`
|
||||||
Date string `yaml:"date"`
|
Date string `yaml:"date"`
|
||||||
New bool `yaml:"new"`
|
New bool `yaml:"new"`
|
||||||
Tags []string
|
Tags []string
|
||||||
|
@ -11,6 +11,7 @@ image640: {{ imageSize .Image "640" }}
|
|||||||
image1024: {{ imageSize .Image "1024" }}
|
image1024: {{ imageSize .Image "1024" }}
|
||||||
tracks: {{ .Tracks }}
|
tracks: {{ .Tracks }}
|
||||||
date: {{ .Date }}
|
date: {{ .Date }}
|
||||||
|
release_date: {{ .ReleaseDate }}
|
||||||
draft: false
|
draft: false
|
||||||
tags: {{ .Tags }}
|
tags: {{ .Tags }}
|
||||||
---
|
---
|
||||||
|
Loading…
Reference in New Issue
Block a user