Skip to content

fix(apple-music): accept user playlist ids containing - and _ - #345

Open
OviiiOne wants to merge 1 commit into
flo-bit:mainfrom
OviiiOne:fix/apple-music-user-playlist-ids
Open

fix(apple-music): accept user playlist ids containing - and _#345
OviiiOne wants to merge 1 commit into
flo-bit:mainfrom
OviiiOne:fix/apple-music-user-playlist-ids

Conversation

@OviiiOne

@OviiiOne OviiiOne commented Aug 1, 2026

Copy link
Copy Markdown

Apple Music cards render a blank embed (grey box with the music-note icon) when the URL points to a user-created playlist.

Repro: add an Apple Music card with https://music.apple.com/es/playlist/mood-booster/pl.u-pMylgvjCxaX69k

Cause: the URL matcher's character class [a-zA-Z0-9.] excludes - and _. User playlist ids are prefixed pl.u-, so the id truncates to pl.u and the iframe loads embed.music.apple.com/es/playlist/pl.u. Album ids (numeric) and Apple-curated playlist ids (hex) don't contain those characters, which is why only user playlists broke.

Fix: widen the class to [a-zA-Z0-9._-] in both places the pattern is duplicated — the onUrlHandler matcher and the creation modal's validation.

Tested with album, Apple-curated playlist and user playlist URLs, with ?i= and ?l= params, across us/es/gb storefronts. Verified in the app on /test-cards in edit and view, light and dark, with an accent-coloured card, on desktop, at 375x812 and in the mobile preview. svelte-check on @blento/web is clean (0 errors, 0 warnings); the @blento/diff-harness failure on pnpm check is pre-existing on main.

🤖 Generated with Claude Code

Apple Music user playlist ids are prefixed `pl.u-`, but the URL matcher's
character class excluded `-` and `_`, truncating `pl.u-pMylgvjCxaX69k`
to `pl.u`. The embed iframe then loaded an invalid path and rendered
blank. Album ids (numeric) and Apple-curated playlist ids (hex) were
unaffected, so the failure only showed up for user playlists.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant