Add top track to weekly post

This commit is contained in:
2023-03-05 22:54:18 +11:00
parent ea9d092505
commit 03bf0eca9f
9 changed files with 95 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
module Adamantium
module Views
module Posts
class TopTracks < Adamantium::View
config.layout = false
expose :name do |track:|
track["name"]
end
expose :artist do |track:|
track.dig("artist", "content")
end
expose :image do |track:|
track["image"].detect { |i| i["size"] == "small" }["content"]
end
expose :url do |track:|
track["url"]
end
end
end
end
end