fix(front): Fixed regex order in embed
Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2642>
This commit is contained in:
parent
a0ae9bbb70
commit
08c142cfff
|
@ -0,0 +1 @@
|
|||
Fixed issue with regular expression in embed.
|
|
@ -82,7 +82,8 @@
|
|||
// that do not support other codecs to be able to play it :)
|
||||
if (sources.length > 0 && !sources.some(({ mimetype }) => mimetype === 'audio/mpeg')) {
|
||||
const source = sources[0].listen_url
|
||||
const url = new URL(source.test(/^https?:/)
|
||||
const regex = /^https?:/
|
||||
const url = new URL(regex.test(source)
|
||||
? source
|
||||
: source[0] === '/'
|
||||
? `${baseUrl}${source}`
|
||||
|
|
Loading…
Reference in New Issue