From c9576697b450d41bebaf664a71815cb6a6bfdfee Mon Sep 17 00:00:00 2001 From: Freya <752642+skyelights@users.noreply.github.com> Date: Mon, 23 Dec 2024 15:15:18 +0100 Subject: [PATCH 1/2] openInApp: add support for geo.music.apple.com links --- src/plugins/openInApp/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/openInApp/index.ts b/src/plugins/openInApp/index.ts index 2d27c2b208..84806d29d2 100644 --- a/src/plugins/openInApp/index.ts +++ b/src/plugins/openInApp/index.ts @@ -57,8 +57,8 @@ const UrlReplacementRules: Record = { description: "Open Tidal links in the Tidal app", }, itunes: { - match: /^https:\/\/music\.apple\.com\/([a-z]{2}\/)?(album|artist|playlist|song|curator)\/([^/?#]+)\/?([^/?#]+)?(?:\?.*)?(?:#.*)?$/, - replace: (_, lang, type, name, id) => id ? `itunes://music.apple.com/us/${type}/${name}/${id}` : `itunes://music.apple.com/us/${type}/${name}`, + match: /^https:\/\/(geo\.)?music\.apple\.com\/([a-z]{2}\/)?(album|artist|playlist|song|curator)\/([^/?#]+)\/?([^/?#]+)?(?:\?.*)?(?:#.*)?$/, + replace: (_, __, lang, type, name, id) => id ? `itunes://music.apple.com/us/${type}/${name}/${id}` : `itunes://music.apple.com/us/${type}/${name}`, description: "Open Apple Music links in the iTunes app" }, }; From c8b951c8cb5f423171e62993592797b168d9be79 Mon Sep 17 00:00:00 2001 From: Fae <752642+faejr@users.noreply.github.com> Date: Wed, 25 Dec 2024 19:50:10 +0100 Subject: [PATCH 2/2] make the geo group non-catching --- src/plugins/openInApp/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/openInApp/index.ts b/src/plugins/openInApp/index.ts index 84806d29d2..09fc2f3b77 100644 --- a/src/plugins/openInApp/index.ts +++ b/src/plugins/openInApp/index.ts @@ -57,8 +57,8 @@ const UrlReplacementRules: Record = { description: "Open Tidal links in the Tidal app", }, itunes: { - match: /^https:\/\/(geo\.)?music\.apple\.com\/([a-z]{2}\/)?(album|artist|playlist|song|curator)\/([^/?#]+)\/?([^/?#]+)?(?:\?.*)?(?:#.*)?$/, - replace: (_, __, lang, type, name, id) => id ? `itunes://music.apple.com/us/${type}/${name}/${id}` : `itunes://music.apple.com/us/${type}/${name}`, + match: /^https:\/\/(?:geo\.)?music\.apple\.com\/([a-z]{2}\/)?(album|artist|playlist|song|curator)\/([^/?#]+)\/?([^/?#]+)?(?:\?.*)?(?:#.*)?$/, + replace: (_, lang, type, name, id) => id ? `itunes://music.apple.com/us/${type}/${name}/${id}` : `itunes://music.apple.com/us/${type}/${name}`, description: "Open Apple Music links in the iTunes app" }, };