The spotify integration connects to a spotify account and keeps track of relevant playlists. In this case it looks at all playlist with #nowplaying' in the title. The tracks are kept track of in the database under atracks` table which allows for some interesting new possibilities. Playlists can be created and manipulated - allowing users to filter the global playlist by certain properties. For example someone may only want to see tracks from people she follows or pre-approved. DJ's can curate the nowplaying playlist with user-requested tracks. It also allows for statistics - we can see the most popular artists, songs, genres.
The Track class is based off of spotify's definition of a track.
class Track = {
spotify_id: string;
name: string;
week: number;
artists: string[];
print()
toString()
}
A playlist is made up of tracks
export class Playlist {
id: string;
name: string;
week: number;
tracks: Track[];
}
The spotify class has a getPlaylists function that returns fully populated playlists. In future pull requests these playlists may be manipulated and rearranged. The reporter will grab the spotify urls directly from spotify, instead of relying on a human to get the link.
Check out the #nowplaying community and bot in action here