diff options
Diffstat (limited to 'types/music.go')
| -rw-r--r-- | types/music.go | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/types/music.go b/types/music.go new file mode 100644 index 0000000..aa41fa7 --- /dev/null +++ b/types/music.go @@ -0,0 +1,59 @@ +package types + +type SourceType string + +const ( + YouTube SourceType = "youtube" + Spotify SourceType = "spotify" +) + +type MusicSearchResult struct { + Title string + Artist string + URL string + ID string + Duration string + Thumbnail string + SourceType SourceType +} + +type SpotifySearchResponse struct { + Tracks struct { + Items []struct { + ID string `json:"id"` + Name string `json:"name"` + Artists []struct { + Name string `json:"name"` + } `json:"artists"` + Album struct { + Images []struct { + URL string `json:"url"` + } `json:"images"` + } `json:"album"` + DurationMs int `json:"duration_ms"` + ExternalUrls struct { + Spotify string `json:"spotify"` + } `json:"external_urls"` + } `json:"items"` + } `json:"tracks"` +} + +type YouTubeSearchResponse struct { + Items []struct { + ID struct { + VideoID string `json:"videoId"` + } `json:"id"` + Snippet struct { + Title string `json:"title"` + ChannelTitle string `json:"channelTitle"` + Thumbnails struct { + Default struct { + URL string `json:"url"` + } `json:"default"` + High struct { + URL string `json:"url"` + } `json:"high"` + } `json:"thumbnails"` + } `json:"snippet"` + } `json:"items"` +} |
