fix(apple-music): accept user playlist ids containing - and _ - #345
Open
OviiiOne wants to merge 1 commit into
Open
fix(apple-music): accept user playlist ids containing - and _#345OviiiOne wants to merge 1 commit into
OviiiOne wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-pMylgvjCxaX69kCause: the URL matcher's character class
[a-zA-Z0-9.]excludes-and_. User playlist ids are prefixedpl.u-, so the id truncates topl.uand the iframe loadsembed.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 — theonUrlHandlermatcher and the creation modal's validation.Tested with album, Apple-curated playlist and user playlist URLs, with
?i=and?l=params, acrossus/es/gbstorefronts. Verified in the app on/test-cardsin edit and view, light and dark, with an accent-coloured card, on desktop, at 375x812 and in the mobile preview.svelte-checkon@blento/webis clean (0 errors, 0 warnings); the@blento/diff-harnessfailure onpnpm checkis pre-existing on main.🤖 Generated with Claude Code