Skip to content

mshick/shick.io

Repository files navigation

Notes

https://matrix.to/#/@mshick:matrix.org https://discordapp.com/users/312396147073220619

This is a Next.js project bootstrapped with create-next-app.

Process for MusicKit MUT updates

  1. Set up authenticated music endpoint, renew-token. Create secret stored in Vercel env.

  2. Set up GitHub repo with a secret, same as in vercel env.

  3. Set up a GitHub Actions workflow to run periodically and:

    1. Hit the renew-token endpoint, using secret
    2. Get response with the new token, ensure it isn't shown in the action logs
    3. Using the vercel cli, (needs .vercel config to link the repo) update the MUSICKIT_MUSIC_USER_TOKEN env var.
    4. Trigger a new deployment.

Now Playing feature

  1. Every X minutes, request /now-playing
  2. /now-playing checks redis for the most recent item
  3. If there is an item, check the created time and the duration, if we're in the window return that item as the current item
  4. If we did not return, get the latest from Apple, store to redis, return