Compare commits
1 Commits
85c6a6cbfb
...
d67835be30
Author | SHA1 | Date | |
---|---|---|---|
d67835be30 |
@ -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 = () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user