Hide recent media on now page if requests fail
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
- if recently_played_music.count > 0
|
||||||
|
h3 🎧 Recently listened to
|
||||||
div class="grid grid-cols-4 gap-2"
|
div class="grid grid-cols-4 gap-2"
|
||||||
- recently_played_music.each do |album|
|
- recently_played_music.each do |album|
|
||||||
a href="#{album[:href]}"
|
a href="#{album[:href]}"
|
||||||
|
@@ -1,3 +1,6 @@
|
|||||||
|
- if recently_played_games.count > 0
|
||||||
|
h3 👾 Recently played on Steam
|
||||||
|
|
||||||
table
|
table
|
||||||
- recently_played_games.each do |game|
|
- recently_played_games.each do |game|
|
||||||
tr
|
tr
|
||||||
|
@@ -7,7 +7,6 @@ module Main
|
|||||||
include Deps["queries.posts.recently_played"]
|
include Deps["queries.posts.recently_played"]
|
||||||
|
|
||||||
expose :recently_played_music do |recently_played_result|
|
expose :recently_played_music do |recently_played_result|
|
||||||
# raise recently_played_result["data"].inspect
|
|
||||||
JSON.parse(recently_played_result)["data"].reject { |a| a["type"] != "albums" }.map do |album|
|
JSON.parse(recently_played_result)["data"].reject { |a| a["type"] != "albums" }.map do |album|
|
||||||
{
|
{
|
||||||
artist: album["attributes"]["artistName"],
|
artist: album["attributes"]["artistName"],
|
||||||
|
Reference in New Issue
Block a user