diff --git a/config/filters.js b/config/filters.js index e29019d8..336bbe59 100644 --- a/config/filters.js +++ b/config/filters.js @@ -11,6 +11,7 @@ module.exports = { mdToHtml: (content) => { return marked.parse(content) }, + dashLower: (string) => string.replace(/\s+/g, '-').toLowerCase(), getPostImage: (image) => { if (image && image !== '') return image return '/assets/img/social-card.webp' @@ -40,7 +41,8 @@ module.exports = { } const filtered = - webmentions.filter((entry) => entry['wm-target'] === `https://coryd.dev${url}`) + webmentions + .filter((entry) => entry['wm-target'] === `https://coryd.dev${url}`) .filter((entry) => allowedTypes.includes(entry['wm-property'])) || [] filtered.forEach((m) => { diff --git a/src/_data/music.js b/src/_data/music.js index 8d34307a..b5c6d26c 100644 --- a/src/_data/music.js +++ b/src/_data/music.js @@ -10,7 +10,7 @@ const aliasArtists = (array) => { } const sanitizeAlbums = (array) => { - const denyList = /(\[|\()(Deluxe Edition|Special Edition|Remastered)(\]|\))/i; + const denyList = /(\[|\()(Deluxe Edition|Special Edition|Remastered)(\]|\))/i array.forEach((a) => { a.name = a.name.replace(denyList, '') }) @@ -51,7 +51,7 @@ module.exports = async function () { while (CURRENT_PAGE < PAGES && hasNextPage) { const URL = `https://api.music.apple.com/v1/me/recent/played/tracks?limit=${PAGE_SIZE}&offset=${ PAGE_SIZE * CURRENT_PAGE - }` + }&extend=album` const tracks = await fetch(URL, { headers: { 'Content-Type': 'application/json', @@ -81,6 +81,7 @@ module.exports = async function () { name: track.attributes['albumName'], artist: track.attributes['artistName'], art: track.attributes.artwork.url.replace('{w}', '300').replace('{h}', '300'), + url: track.attributes.url, plays: 1, } } else { diff --git a/src/_includes/partials/now/albums.liquid b/src/_includes/partials/now/albums.liquid index b071964e..785a0a36 100644 --- a/src/_includes/partials/now/albums.liquid +++ b/src/_includes/partials/now/albums.liquid @@ -5,7 +5,7 @@
{% for album in music.albums %} - +