diff --git a/api/music.js b/api/music.js index 90a6af54..a63f52e4 100644 --- a/api/music.js +++ b/api/music.js @@ -24,6 +24,7 @@ export default async (request) => { const albums = getStore('albums') const artistsMap = await artists.get('artists-map', { type: 'json' }) const albumsMap = await albums.get('albums-map', { type: 'json' }) + const nowPlaying = await scrobbles.get('now-playing', { type: 'json'}) if (week) { const weekData = await scrobbles.get(week, { type: 'json'}) @@ -35,6 +36,7 @@ export default async (request) => { return new Response(JSON.stringify({ scrobbles: scrobbleData, + nowPlaying, artists: artistsMap, albums: albumsMap }), diff --git a/src/pages/music.liquid b/src/pages/music.liquid new file mode 100644 index 00000000..9975962f --- /dev/null +++ b/src/pages/music.liquid @@ -0,0 +1,9 @@ +--- +title: Music +layout: default +permalink: /music.html +description: "See what I'm listening to." +--- +{%- assign artist = music.artists | first -%} +{%- assign album = music.albums | first -%} +Lately I've been listening to a lot of {{ artist.title }}, and the album {{ album.title }}. The last track I listened to was {{ music.nowPlaying.track }} by {{ music.nowPlaying.artist }}. \ No newline at end of file