chore: drop unused data; simplify music name

This commit is contained in:
Cory Dransfeldt 2023-06-23 12:46:49 -07:00
parent 67bd7fb798
commit cd09c2735c
No known key found for this signature in database
3 changed files with 4 additions and 24 deletions

View file

@ -1,20 +0,0 @@
const EleventyFetch = require('@11ty/eleventy-fetch')
module.exports = async function () {
const APPLE_BEARER = process.env.API_BEARER_APPLE_MUSIC
const APPLE_TOKEN = process.env.API_TOKEN_APPLE_MUSIC
const url = `https://api.music.apple.com/v1/me/history/heavy-rotation`
const res = EleventyFetch(url, {
duration: '1h',
type: 'json',
fetchOptions: {
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${APPLE_BEARER}`,
'music-user-token': `${APPLE_TOKEN}`,
},
},
}).catch()
const rotation = await res
return rotation.data
}

View file

@ -49,13 +49,13 @@ layout: main
<a href="https://github.com/cdransf/awesome-adblock">Assembling lists of ad and tracker-blocking tools.</a>
</p>
</div>
{% if recentTracks.size > 0 %}
{% if music.size > 0 %}
<h2 class="m-0 text-xl flex flex-row items-center font-black leading-tight tracking-normal dark:text-gray-200 md:text-2xl mt-8 mb-4">
{% heroicon "outline" "microphone" "Artists" "height=28" %}
<div class="ml-1">Artists</div>
</h2>
<div class="grid grid-cols-2 gap-2 md:grid-cols-4 not-prose">
{% for artist in recentTracks.artists %}
{% for artist in music.artists %}
<a href="https://rateyourmusic.com/search?searchterm={{ artist.name | escape }}" title="{{artist.name | escape}}">
<div class="relative block">
<div class="absolute left-0 top-0 h-full w-full rounded-lg border border-purple-600 hover:border-purple-500 bg-cover-gradient dark:border-purple-400 dark:hover:border-purple-500"></div>
@ -73,13 +73,13 @@ layout: main
{% endfor %}
</div>
{% endif %}
{% if recentTracks.size > 0 %}
{% if music.size > 0 %}
<h2 class="m-0 text-xl flex flex-row items-center font-black leading-tight tracking-normal dark:text-gray-200 md:text-2xl mt-8 mb-4">
{% heroicon "outline" "musical-note" "Albums" "height=28" %}
<div class="ml-1">Albums</div>
</h2>
<div class="grid grid-cols-2 gap-2 md:grid-cols-4 not-prose">
{% for album in recentTracks.albums %}
{% for album in music.albums %}
<a href="https://rateyourmusic.com/search?searchtype=l&searchterm={{album.name | escape}}" title="{{album.name | escape}}">
<div class="relative block">
<div class="absolute left-0 top-0 h-full w-full rounded-lg border border-purple-600 hover:border-purple-500 bg-cover-gradient dark:border-purple-400 dark:hover:border-purple-500"></div>