Skip to content

Commit 67dd63c

Browse files
authored
add temp patch to redirect to quickpatch-till-music-is-live if retreive_audio_src is breaking
1 parent 3dd8e27 commit 67dd63c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

MUSICPLAYER.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,17 @@
337337
try {
338338
PLAYLIST_SONGS[next_song].src = await retreive_audio_src(PLAYLIST_SONGS[next_song].key);
339339
} catch (err) {
340+
// begin temp patch
341+
// while the retreive_audio_src is unreliable display the alternative as a link on the page
342+
const brokenButtonId = 'brokenRedirect';
343+
if (! document.querySelector(`#${brokenButtonId}`)) {
344+
var a = document.createElement('button');
345+
a.click = () => {window.open(window.location.pathname.replace('/main/','quickpatch-till-music-is-live'), '_self');};
346+
a.innerText = `Errors while attempting to retreive the audio src key. Click here to use the other version of the app.`;
347+
a.id = 'brokenRedirect';
348+
document.body.insertBefore(a, document.body.firstChild);
349+
}
350+
// end temp patch
340351
console.log(`Error while attempting to get src from song index #${next_song}, key = '${PLAYLIST_SONGS[next_song].key}', name = '${PLAYLIST_SONGS[next_song].name}', skipping to next index!`);
341352
next_song++;
342353
}

0 commit comments

Comments
 (0)