Skip to content

Commit

Permalink
OpenInApp: Add support for localization in Spotify URL regex (#2776)
Browse files Browse the repository at this point in the history
  • Loading branch information
wrrdv authored Sep 1, 2024
1 parent e07a4e1 commit b595a3e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugins/openInApp/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface URLReplacementRule {
// Do not forget to add protocols to the ALLOWED_PROTOCOLS constant
const UrlReplacementRules: Record<string, URLReplacementRule> = {
spotify: {
match: /^https:\/\/open\.spotify\.com\/(track|album|artist|playlist|user|episode)\/(.+)(?:\?.+?)?$/,
match: /^https:\/\/open\.spotify\.com\/(?:intl-[a-z]{2}\/)?(track|album|artist|playlist|user|episode)\/(.+)(?:\?.+?)?$/,
replace: (_, type, id) => `spotify://${type}/${id}`,
description: "Open Spotify links in the Spotify app",
shortlinkMatch: /^https:\/\/spotify\.link\/.+$/,
Expand Down

0 comments on commit b595a3e

Please sign in to comment.