kylejohnson / Patiobar

A web frontend for pianobar, which is a CLI frontend for Pandora.
MIT License
62 stars 22 forks source link

Auto refresh on Song Change #19

Closed tracerrx closed 3 years ago

tracerrx commented 6 years ago

I added the below to make the screen refresh upon a change in the nowplaying file (my filename differs from your CurrentSong file)

`var fs = require('fs'); var filePath = process.env.HOME + '/.config/pianobar/nowplaying'; var file = fs.readFileSync(filePath); console.log('Initial File content: ' + file);

fs.watch(filePath, function(event, filename) { if(filename){ console.log('Event : ' + event); console.log(filename + ' file Changed ...'); file = fs.readFileSync(filePath); console.log('File content at : ' + new Date() + ' is \n' + file); readCurrentSong(); } else{ console.log('filename not provided') } });`

mralexgray commented 6 years ago

i agree this feature is a MUST. however, @tracerrx you should really fork the repo, and push your pull request if you think this addresses the missing feature....

kylejohnson commented 6 years ago

I'm not sure why this is necessary - the UI should automatically update the relevant elements (song title, album art, etc) when the song changes, without doing a full page refresh. Is this not happening?

tracerrx commented 6 years ago

Was not working on chrome 67/macos until I made the changes

USAFPride commented 6 years ago

Current Chrome version is 68.0.3440.84. The UI updates without these changes.