Compare commits

..

1 Commits

Author SHA1 Message Date
d67835be30 add hacky fix for radio stopping 2020-02-23 19:36:38 -05:00

View File

@ -1,7 +1,7 @@
const { spawnSync } = require('child_process')
const fs = require('fs')
const playing = null
let playing = null
const getPlaylist = () => {
const { stderr, stdout } = spawnSync('mpc', ['playlist'])
@ -10,12 +10,11 @@ const getPlaylist = () => {
const poll = () => {
const { stdout } = spawnSync('mpc', ['status'])
console.log('testing for radio stop:', stdout.toString())
const nowPlaying = stdout.toString()
if (nowPlaying === playing) {
console.log('Song stopped playing. Skipping.')
if (playing === nowPlaying) {
console.log('Song stopped playing. Skipping\n', nowPlaying)
spawnSync('mpc', ['next'])
} else playing === nowPlaying
} else playing = nowPlaying
}
const getCurrentTrack = () => {