Remove \u0000 from string

This commit is contained in:
dbroqua 2019-12-30 10:07:04 +01:00
parent 2812176393
commit 41d50ebf0c

View file

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