Fix embedded player

environments/review-front-wvff-cfe5gn/deployments/13838
wvffle 2022-09-26 18:25:17 +00:00
rodzic 132974959b
commit 50fd01de1a
1 zmienionych plików z 5 dodań i 5 usunięć

Wyświetl plik

@ -54,8 +54,8 @@
const getTracksUrl = () => type === 'track' const getTracksUrl = () => type === 'track'
? `${baseUrl}/api/v1/tracks/${id}` ? `${baseUrl}/api/v1/tracks/${id}`
: type === 'playlist' : type === 'playlist'
? ${baseUrl}`/api/v1/playlists/${id}/tracks/` ? `${baseUrl}/api/v1/playlists/${id}/tracks/`
: ${baseUrl}`/api/v1/tracks/` : `${baseUrl}/api/v1/tracks/`
const getAudioSources = (uploads) => { const getAudioSources = (uploads) => {
const sources = uploads const sources = uploads
@ -65,9 +65,9 @@
// NOTE: For backwards compatibilty, prepend the baseUrl if listen_url starts with a slash // NOTE: For backwards compatibilty, prepend the baseUrl if listen_url starts with a slash
.map(source => ({ .map(source => ({
...source, ...source,
listen_url: listen_url[0] === '/' listen_url: source.listen_url[0] === '/'
? `${baseUrl}${listen_url}` ? `${baseUrl}${source.listen_url}`
: listen_url : source.listen_url
})) }))
// NOTE: Add a transcoded MP3 src at the end for browsers // NOTE: Add a transcoded MP3 src at the end for browsers