refactor: create struct Item

This commit is contained in:
rick 2021-09-01 12:24:04 +02:00
parent ea2eed9bf8
commit d1def640ca
Signed by: Rick
GPG key ID: 2B593F087240EE99

View file

@ -29,20 +29,16 @@ func (rp *RespBandcamp) Add(tmp UrlBandcamp) []UrlBandcamp {
return rp.Urls return rp.Urls
} }
type SpotifyPlaylist struct { type SpotifyItem struct {
Href string `json:"href"`
Items []struct {
AddedAt time.Time `json:"added_at"` AddedAt time.Time `json:"added_at"`
AddedBy struct { AddedBy struct {
ExternalUrls struct { ExternalUrls struct {
Spotify string `json:"spotify"` Spotify string `json:"spotify"`
} `json:"external_urls"` } `json:"external_urls"`
Href string `json:"href"` Href string `json:"href"`
ID string `json:"id"` ID string `json:"id"`
Type string `json:"type"` Type string `json:"type"`
URI string `json:"uri"` URI string `json:"uri"`
} `json:"added_by"` } `json:"added_by"`
IsLocal bool `json:"is_local"` IsLocal bool `json:"is_local"`
PrimaryColor interface{} `json:"primary_color"` PrimaryColor interface{} `json:"primary_color"`
@ -52,19 +48,16 @@ type SpotifyPlaylist struct {
Artists []struct { Artists []struct {
ExternalUrls struct { ExternalUrls struct {
Spotify string `json:"spotify"` Spotify string `json:"spotify"`
} `json:"external_urls"` } `json:"external_urls"`
Href string `json:"href"` Href string `json:"href"`
ID string `json:"id"` ID string `json:"id"`
Name string `json:"name"` Name string `json:"name"`
Type string `json:"type"` Type string `json:"type"`
URI string `json:"uri"` URI string `json:"uri"`
} `json:"artists"` } `json:"artists"`
AvailableMarkets []string `json:"available_markets"` AvailableMarkets []string `json:"available_markets"`
ExternalUrls struct { ExternalUrls struct {
Spotify string `json:"spotify"` Spotify string `json:"spotify"`
} `json:"external_urls"` } `json:"external_urls"`
Href string `json:"href"` Href string `json:"href"`
ID string `json:"id"` ID string `json:"id"`
@ -72,7 +65,6 @@ type SpotifyPlaylist struct {
Height int `json:"height"` Height int `json:"height"`
URL string `json:"url"` URL string `json:"url"`
Width int `json:"width"` Width int `json:"width"`
} `json:"images"` } `json:"images"`
Name string `json:"name"` Name string `json:"name"`
ReleaseDate string `json:"release_date"` ReleaseDate string `json:"release_date"`
@ -80,19 +72,16 @@ type SpotifyPlaylist struct {
TotalTracks int `json:"total_tracks"` TotalTracks int `json:"total_tracks"`
Type string `json:"type"` Type string `json:"type"`
URI string `json:"uri"` URI string `json:"uri"`
} `json:"album"` } `json:"album"`
Artists []struct { Artists []struct {
ExternalUrls struct { ExternalUrls struct {
Spotify string `json:"spotify"` Spotify string `json:"spotify"`
} `json:"external_urls"` } `json:"external_urls"`
Href string `json:"href"` Href string `json:"href"`
ID string `json:"id"` ID string `json:"id"`
Name string `json:"name"` Name string `json:"name"`
Type string `json:"type"` Type string `json:"type"`
URI string `json:"uri"` URI string `json:"uri"`
} `json:"artists"` } `json:"artists"`
AvailableMarkets []string `json:"available_markets"` AvailableMarkets []string `json:"available_markets"`
DiscNumber int `json:"disc_number"` DiscNumber int `json:"disc_number"`
@ -101,11 +90,9 @@ type SpotifyPlaylist struct {
Explicit bool `json:"explicit"` Explicit bool `json:"explicit"`
ExternalIds struct { ExternalIds struct {
Isrc string `json:"isrc"` Isrc string `json:"isrc"`
} `json:"external_ids"` } `json:"external_ids"`
ExternalUrls struct { ExternalUrls struct {
Spotify string `json:"spotify"` Spotify string `json:"spotify"`
} `json:"external_urls"` } `json:"external_urls"`
Href string `json:"href"` Href string `json:"href"`
ID string `json:"id"` ID string `json:"id"`
@ -117,18 +104,18 @@ type SpotifyPlaylist struct {
TrackNumber int `json:"track_number"` TrackNumber int `json:"track_number"`
Type string `json:"type"` Type string `json:"type"`
URI string `json:"uri"` URI string `json:"uri"`
} `json:"track"` } `json:"track"`
VideoThumbnail struct { VideoThumbnail struct {
URL interface{} `json:"url"` URL interface{} `json:"url"`
} `json:"video_thumbnail"` } `json:"video_thumbnail"`
}
} `json:"items"` type SpotifyPlaylist struct {
Href string `json:"href"`
Items SpotifyItem `json:"items"`
Limit int `json:"limit"` Limit int `json:"limit"`
Next string `json:"next"` Next string `json:"next"`
Offset int `json:"offset"` Offset int `json:"offset"`
Previous interface{} `json:"previous"` Previous interface{} `json:"previous"`
Total int `json:"total"` Total int `json:"total"`
} }