Merge pull request #332 from Phlogi/fix-regexp

fix(ui): improve spotify url regex to support more formats
This commit is contained in:
Spotizerr
2025-08-26 19:58:33 -06:00
committed by GitHub

View File

@@ -34,7 +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 spotifyUrlRegex = /https:\/\/open\.spotify\.com\/(?:[a-zA-Z0-9-]+\/)*(playlist|album|artist|track)\/([a-zA-Z0-9]+)/;
const match = q.match(spotifyUrlRegex);
if (match) {