turbowookie / turbo-wookie

Turbo Wookie Project. Because Turbo Wookie
http://turbowookie.github.io
BSD 3-Clause "New" or "Revised" License
9 stars 2 forks source link

MPD doesn't autoplay when a song is added #12

Closed mpeterson2 closed 10 years ago

mpeterson2 commented 10 years ago

If there are no songs in the playlist to start with and you add a to the playlist, you have to tell MPD to play before you can pick up the stream again.

Likewise on the frontend, you have to refresh the page in order to get the stream to work again.

sleepdeprecation commented 10 years ago

I can look into it tomorrow/when I wake up.

sleepdeprecation commented 10 years ago

It might now...

Let me take a look.

sleepdeprecation commented 10 years ago

So ... the server will automatically start playing, but the frontend doesn't update. Similarly, when the queue is empty, the server now adds a random song, the client doesn't know to update and doesn't play the newly added song...

mpeterson2 commented 10 years ago

Yeah, I'm not sure how we are going to be able to do this. We may be able to set it up a stream if you can figure that out. We can request from /upcoming and you can stream updates to use?

sleepdeprecation commented 10 years ago

If I can't figure what out? If either mpd is stopped, with a playlist, or doesn't have a playlist, if you add a song, it will start playing.

This is new as of five minutes ago.

sleepdeprecation commented 10 years ago

Okay, I read your comment wrong.

We could send back more than just the "note: song added" in that case. We could add a "command" field, which tells the client things (like: refresh everything)...

mpeterson2 commented 10 years ago

Well we need to be able to hear when other clients add things as well.

By figure it out, I meant if you can figure out how to keep the connection alive and send the playlist to the browser when there is an update.

sleepdeprecation commented 10 years ago

Thought: if the server starts up and MPD isn't playing, have it randomly select a song (like it does when the queue runs out). Problem averted.

mpeterson2 commented 10 years ago

Sounds good.