Compare commits
1 Commits
85c6a6cbfb
...
d67835be30
Author | SHA1 | Date | |
---|---|---|---|
d67835be30 |
@ -1,7 +1,7 @@
|
|||||||
const { spawnSync } = require('child_process')
|
const { spawnSync } = require('child_process')
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
|
|
||||||
const playing = null
|
let playing = null
|
||||||
|
|
||||||
const getPlaylist = () => {
|
const getPlaylist = () => {
|
||||||
const { stderr, stdout } = spawnSync('mpc', ['playlist'])
|
const { stderr, stdout } = spawnSync('mpc', ['playlist'])
|
||||||
@ -10,12 +10,11 @@ const getPlaylist = () => {
|
|||||||
|
|
||||||
const poll = () => {
|
const poll = () => {
|
||||||
const { stdout } = spawnSync('mpc', ['status'])
|
const { stdout } = spawnSync('mpc', ['status'])
|
||||||
console.log('testing for radio stop:', stdout.toString())
|
|
||||||
const nowPlaying = stdout.toString()
|
const nowPlaying = stdout.toString()
|
||||||
if (nowPlaying === playing) {
|
if (playing === nowPlaying) {
|
||||||
console.log('Song stopped playing. Skipping.')
|
console.log('Song stopped playing. Skipping\n', nowPlaying)
|
||||||
spawnSync('mpc', ['next'])
|
spawnSync('mpc', ['next'])
|
||||||
} else playing === nowPlaying
|
} else playing = nowPlaying
|
||||||
}
|
}
|
||||||
|
|
||||||
const getCurrentTrack = () => {
|
const getCurrentTrack = () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user