From cb3e867300eadc0bd8445af306696b9fd7210351 Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Mon, 17 Jul 2023 12:59:51 -0700 Subject: [PATCH] fix: albums that don't have a valid link --- src/404.html | 2 +- src/_data/music.js | 4 +++- src/_includes/partials/now/albumReleases.liquid | 2 +- src/_includes/partials/now/albums.liquid | 2 +- src/_includes/partials/now/artists.liquid | 2 +- src/_includes/partials/now/books.liquid | 2 +- src/_includes/partials/now/links.liquid | 2 +- src/_includes/partials/now/movies.liquid | 2 +- src/_includes/partials/now/tv.liquid | 2 +- src/_includes/partials/popular-posts.liquid | 2 +- src/_includes/webrings/the-claw.liquid | 2 +- src/now.html | 4 ++-- tailwind.css | 4 ++++ 13 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/404.html b/src/404.html index 76cebfc8..8e912618 100644 --- a/src/404.html +++ b/src/404.html @@ -11,7 +11,7 @@ permalink: 404.html
- + {% tablericon "receipt-2" "Receipt" "width=20 height=20" %} Skip out on the room service bill diff --git a/src/_data/music.js b/src/_data/music.js index e234c234..bedc4e93 100644 --- a/src/_data/music.js +++ b/src/_data/music.js @@ -80,7 +80,9 @@ module.exports = async function () { name: track.attributes['albumName'], artist: track.attributes['artistName'], art: track.attributes.artwork.url.replace('{w}', '300').replace('{h}', '300'), - url: `https://song.link/${track['relationships'].albums.data.pop().attributes.url}`, + url: track['relationships'] + ? `https://song.link/${track['relationships'].albums.data.pop().attributes.url}` + : `https://rateyourmusic.com/search?searchtype=l&searchterm=${track.attributes['albumName']}%20${track.attributes['artistName']}`, plays: 1, } } else { diff --git a/src/_includes/partials/now/albumReleases.liquid b/src/_includes/partials/now/albumReleases.liquid index 71b2f7e1..a135e07d 100644 --- a/src/_includes/partials/now/albumReleases.liquid +++ b/src/_includes/partials/now/albumReleases.liquid @@ -1,5 +1,5 @@ {% if albumReleases.size > 0 %} -

+

{% tablericon "calendar-time" "Anticipated albums" "height=28" %}
Anticipated albums

diff --git a/src/_includes/partials/now/albums.liquid b/src/_includes/partials/now/albums.liquid index 98a7ac1f..8810a892 100644 --- a/src/_includes/partials/now/albums.liquid +++ b/src/_includes/partials/now/albums.liquid @@ -1,5 +1,5 @@ {% if music.size > 0 %} -

+

{% tablericon "vinyl" "Albums" "height=28" %}
Albums

diff --git a/src/_includes/partials/now/artists.liquid b/src/_includes/partials/now/artists.liquid index 1d3706bb..c1ae0d20 100644 --- a/src/_includes/partials/now/artists.liquid +++ b/src/_includes/partials/now/artists.liquid @@ -1,5 +1,5 @@ {% if music.size > 0 %} -

+

{% tablericon "microphone-2" "Artists" "height=28" %}
Artists

diff --git a/src/_includes/partials/now/books.liquid b/src/_includes/partials/now/books.liquid index 93dd384b..92a5d2f4 100644 --- a/src/_includes/partials/now/books.liquid +++ b/src/_includes/partials/now/books.liquid @@ -1,5 +1,5 @@ {% if books.size > 0 %} -

+

{% tablericon "books" "Books" "height=28" %}
Books

diff --git a/src/_includes/partials/now/links.liquid b/src/_includes/partials/now/links.liquid index de36bc63..0f3515ce 100644 --- a/src/_includes/partials/now/links.liquid +++ b/src/_includes/partials/now/links.liquid @@ -1,5 +1,5 @@ {% if links.size > 0 %} -

+

{% tablericon "link" "Links" "height=28" %}
Links

diff --git a/src/_includes/partials/now/movies.liquid b/src/_includes/partials/now/movies.liquid index 119d8e6f..24f962c3 100644 --- a/src/_includes/partials/now/movies.liquid +++ b/src/_includes/partials/now/movies.liquid @@ -1,5 +1,5 @@ {% if movies.size > 0 %} -

+

{% tablericon "movie" "Movies" "height=28" %}
Movies

diff --git a/src/_includes/partials/now/tv.liquid b/src/_includes/partials/now/tv.liquid index d96c8cf0..afbab0dc 100644 --- a/src/_includes/partials/now/tv.liquid +++ b/src/_includes/partials/now/tv.liquid @@ -1,5 +1,5 @@ {% if tv.size > 0 %} -

+

{% tablericon "device-tv" "TV" "height=28" %}
TV

diff --git a/src/_includes/partials/popular-posts.liquid b/src/_includes/partials/popular-posts.liquid index b79c52ab..4bb647f7 100644 --- a/src/_includes/partials/popular-posts.liquid +++ b/src/_includes/partials/popular-posts.liquid @@ -1,6 +1,6 @@ {% assign posts = posts | getPopularPosts: analytics %}