-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add spotify_artist data source and add functionality to spotify_album #34
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## main #34 +/- ##
==========================================
- Coverage 71.60% 70.34% -1.26%
==========================================
Files 9 10 +1
Lines 493 553 +60
==========================================
+ Hits 353 389 +36
- Misses 97 119 +22
- Partials 43 45 +2
Continue to review full report at Codecov.
|
"tracks": { | ||
Type: schema.TypeList, | ||
Computed: true, | ||
Elem: &schema.Schema{Type: schema.TypeString}, | ||
Description: "The spotify IDs of the tracks", | ||
}, | ||
"track_names": { | ||
Type: schema.TypeList, | ||
Computed: true, | ||
Elem: &schema.Schema{Type: schema.TypeString}, | ||
Description: "The names of the tracks", | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe instead of having 2 lists of strings, we could have a complex list
"tracks": { | |
Type: schema.TypeList, | |
Computed: true, | |
Elem: &schema.Schema{Type: schema.TypeString}, | |
Description: "The spotify IDs of the tracks", | |
}, | |
"track_names": { | |
Type: schema.TypeList, | |
Computed: true, | |
Elem: &schema.Schema{Type: schema.TypeString}, | |
Description: "The names of the tracks", | |
}, | |
"tracks": { | |
Type: schema.TypeList, | |
Computed: true, | |
Elem: &schema.Resource{ | |
Schema: map[string]*schema.Schema{ | |
"name": { | |
Type: schema.TypeString, | |
Description: "The name of the track", | |
}, | |
"id": { | |
Type: schema.TypeString, | |
Description: "The Spotify ID of the track", | |
}, | |
}, | |
Description: "The tracks of the album", | |
}, | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can still get the individual items using splat expressions, so instead of data.spotify_album.foo.track_names
it would become data.spotify_album.foo.tracks[*].name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you could add some tests too, thanks :)
Few additions and improvements,
spotify_artist
data source to query artist ID/URL and retrievename
spotify_album
to have additionaltracks
andtrack_names
dataExample of new data sources in-use: https://github.com/ecliptik/minidisc-playlist