Update Wavlake embed to support .com links

This commit is contained in:
Michael Rhee 2023-03-29 16:01:54 -05:00
parent d24fc57962
commit a21e99fff8
No known key found for this signature in database
2 changed files with 2 additions and 3 deletions

View File

@ -168,5 +168,4 @@ export const MagnetRegex = /(magnet:[\S]+)/i;
/**
* Wavlake embed regex
*/
export const WavlakeRegex =
/player\.wavlake\.com\/(?!feed\/)(track\/[.a-zA-Z0-9-]+|album\/[.a-zA-Z0-9-]+|[.a-zA-Z0-9-]+)/i;
export const WavlakeRegex = /(?:player\.)?wavlake\.com\/(track\/[.a-zA-Z0-9-]+|album\/[.a-zA-Z0-9-]+|[.a-zA-Z0-9-]+)/i;

View File

@ -1,5 +1,5 @@
const WavlakeEmbed = ({ link }: { link: string }) => {
const convertedUrl = link.replace("player.wavlake.com", "embed.wavlake.com");
const convertedUrl = link.replace(/(?:player\.)?wavlake\.com/, "embed.wavlake.com");
return (
<iframe