Skip to content

Commit

Permalink
Add Amazon & YouTube Music links to albums
Browse files Browse the repository at this point in the history
  • Loading branch information
jerodsanto committed Feb 14, 2024
1 parent 9029743 commit 59ddb96
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 5 deletions.
2 changes: 2 additions & 0 deletions assets/app/layout/show.scss
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@

&--apple { background-image: url('../images/icons/podcast_icon-apple.png'); }
&--apple-music { background-image: url('../images/icons/podcast_icon-apple-music.png'); }
&--amazon-music { background-image: url('../images/icons/podcast_icon-amazon-music.png'); }
&--youtube-music { background-image: url('../images/icons/podcast_icon-youtube-music.png'); }
&--bandcamp { background-image: url('../images/icons/podcast_icon-bandcamp.png'); }
&--overcast { background-image: url('../images/icons/podcast_icon-overcast.png'); }
&--spotify { background-image: url('../images/icons/podcast_icon-spotify.png'); }
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 18 additions & 1 deletion lib/changelog/schema/album.ex
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
defmodule Changelog.Album do
defstruct [:name, :slug, :volume, :tagline, :description, :apple_id, :spotify_id, :bandcamp_url]
defstruct [
:name,
:slug,
:volume,
:tagline,
:description,
:apple_id,
:spotify_id,
:amazon_id,
:youtube_id,
:bandcamp_url
]

def all do
[theme_songs(), next_level(), dance_party()]
Expand All @@ -19,6 +30,8 @@ defmodule Changelog.Album do
"This album kicks off with our classic podcast opening themes, carries through with some remixes & outros, then shifts gears to a brand new set of Sonic-inspired theme remixes ♻️",
apple_id: "1712599257",
spotify_id: "6MbcbUgjzk6B56U2xocLpH",
amazon_id: "B0CLTLZ7QL",
youtube_id: "OLAK5uy_mEi7GRHCf_VWH-wOYiUtZD6Tb1ALHZbqc",
bandcamp_url:
"https://breakmastercylinder.bandcamp.com/album/changelog-beats-volumes-0-theme-songs"
}
Expand All @@ -34,6 +47,8 @@ defmodule Changelog.Album do
"From Castlevania to Contra to Zelda & many more... This album is inspired by the nostalgic soundtracks from the games of our youth 🕹️",
apple_id: "1712372577",
spotify_id: "5Kb5EvYAgQ40BkTEXbhZ4k",
amazon_id: "B0CL7MZVXK",
youtube_id: "OLAK5uy_mIqRK-PMddNVrhTD6TemOa7QZVifOJFMs",
bandcamp_url:
"https://breakmastercylinder.bandcamp.com/album/changelog-beats-volumes-1-next-level"
}
Expand All @@ -49,6 +64,8 @@ defmodule Changelog.Album do
"Double dog dare you to listen to this bundle of BMC bangers and try NOT to dance your pretty little face off 🫠",
apple_id: "1729386895",
spotify_id: "1pTOAGNr05QRkjaYoxtUY8",
amazon_id: "B0CTR7CF31",
youtube_id: "OLAK5uy_lYViVKgbHykFiWAkEpXR4NHJzpoEf8ERM",
bandcamp_url:
"https://breakmastercylinder.bandcamp.com/album/changelog-beats-volumes-2-dance-party"
}
Expand Down
23 changes: 20 additions & 3 deletions lib/changelog_web/templates/album/_listen_buttons.html.heex
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
<div class="show-header-subscribe">
<div class="show-header-subscribe-buttons">
<%= link("Spotify", to: spotify_url(@album), class: "show-header-subscribe-buttons-item show-header-subscribe-buttons-item--spotify", title: "Listen on Spotify") %>
<%= link("Apple Music", to: apple_music_url(@album), class: "show-header-subscribe-buttons-item show-header-subscribe-buttons-item--apple-music", title: "Listen on Apple Music") %>
<%= link("Bandcamp", to: @album.bandcamp_url, class: "show-header-subscribe-buttons-item show-header-subscribe-buttons-item--bandcamp", title: "Buy on Bandcamp") %>
<%= link("Spotify",
to: spotify_url(@album),
class: "show-header-subscribe-buttons-item show-header-subscribe-buttons-item--spotify",
title: "Listen on Spotify") %>
<%= link("Apple Music",
to: apple_music_url(@album),
class: "show-header-subscribe-buttons-item show-header-subscribe-buttons-item--apple-music",
title: "Listen on Apple Music") %>
<%= link("Amazon Music",
to: amazon_music_url(@album),
class: "show-header-subscribe-buttons-item show-header-subscribe-buttons-item--amazon-music",
title: "Listen on Amazon Music") %>
<%= link("YouTube Music",
to: youtube_music_url(@album),
class: "show-header-subscribe-buttons-item show-header-subscribe-buttons-item--youtube-music",
title: "Listen on YouTube Music") %>
<%= link("Bandcamp",
to: @album.bandcamp_url,
class: "show-header-subscribe-buttons-item show-header-subscribe-buttons-item--bandcamp",
title: "Buy on Bandcamp") %>
</div>
</div>
4 changes: 3 additions & 1 deletion lib/changelog_web/templates/album/_listen_tooltip.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
<div class="tooltip-wrap">
<ul class="tooltip-list">
<li class="tooltip-list-heading">Listen</li>
<li><%= link("Apple Music", to: apple_music_url(@album)) %></li>
<li><%= link("Spotify", to: spotify_url(@album)) %></li>
<li><%= link("Apple Music", to: apple_music_url(@album)) %></li>
<li><%= link("Amazon Music", to: amazon_music_url(@album)) %></li>
<li><%= link("YouTube Music", to: youtube_music_url(@album)) %></li>
<li><%= link("Bandcamp", to: @album.bandcamp_url) %></li>
</ul>
</div>
Expand Down
8 changes: 8 additions & 0 deletions lib/changelog_web/views/album_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ defmodule ChangelogWeb.AlbumView do
"https://cdn.changelog.com/albums/#{album.volume}-#{album.slug}-#{version}.jpg"
end

def amazon_music_url(album) do
"https://music.amazon.com/albums/#{album.amazon_id}"
end

def apple_music_url(album) do
"https://music.apple.com/us/album/#{album.slug}/#{album.apple_id}"
end
Expand All @@ -17,6 +21,10 @@ defmodule ChangelogWeb.AlbumView do
"https://open.spotify.com/embed/album/#{album.spotify_id}"
end

def youtube_music_url(album) do
"https://music.youtube.com/playlist?list=#{album.youtube_id}"
end

def header_art_attrs(album) do
%{
src: art_url(album, 'full'),
Expand Down

0 comments on commit 59ddb96

Please sign in to comment.