Fixed bug on escape string

This commit is contained in:
dbroqua 2019-12-29 21:31:23 +01:00
parent 3c086dc51a
commit 2812176393

View file

@ -65,8 +65,9 @@ if (!process.env.STREAM_TYPE || process.env.STREAM_TYPE === 'radio') {
// Listener on new song
stream.on('metadata', function (data) {
let song = data.replace(/[^A-Za-z 0-9 .,?""!@#$%^&*()-_=+;:<>/\\|}{[\]`~]*/g, '')
song = song.substring(12, song.length - 1)
console.log('RAW DATA:', data)
// let song = data.replace(/[^A-Za-z 0-9 .,?""!@#$%^&*()-_=+;:<>/\\|}{[\]`~]*/g, '')
const song = data.substring(13, data.length - 1).replace('\';', '')
// Extract artist = title from song
const splitted = song.split(' - ')