From be17ff95b0db8bafd39f60586e437e003abaa7bf Mon Sep 17 00:00:00 2001 From: Phlogi Date: Tue, 26 Aug 2025 21:09:38 +0200 Subject: [PATCH] fix(ui): improve spotify url regex to support more formats --- spotizerr-ui/src/router.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spotizerr-ui/src/router.tsx b/spotizerr-ui/src/router.tsx index d025d2e..98d56b9 100644 --- a/spotizerr-ui/src/router.tsx +++ b/spotizerr-ui/src/router.tsx @@ -34,8 +34,7 @@ export const indexRoute = createRoute({ loader: async ({ deps: { q, type } }) => { if (!q || q.length < 3) return { items: [] }; - const spotifyUrlRegex = /https:\/\/open\.spotify\.com\/(playlist|album|artist|track)\/([a-zA-Z0-9]+)/; - const match = q.match(spotifyUrlRegex); + const spotifyUrlRegex = /https:\/\/open\.spotify\.com\/(?:[a-zA-Z0-9-]+\/)*(playlist|album|artist|track)\/([a-zA-Z0-9]+)/; const match = q.match(spotifyUrlRegex); if (match) { const [, urlType, id] = match;