Update stream title info and restore adding radio special case.

This commit is contained in:
Nick Steel 2015-11-09 22:58:16 +00:00
parent 4087cf9379
commit a5255484d4
2 changed files with 9 additions and 10 deletions

View File

@ -8,6 +8,13 @@ function playBrowsedTracks(action, trackIndex) {
if (typeof trackIndex === 'undefined') {
trackIndex = $('#popupBrowse').data("tlid");
}
if (action == PLAY_ALL) {
mopidy.tracklist.clear();
// Default for radio streams is to just add the selected URI.
if (isStreamUri(browseTracks[trackIndex].uri)) {
action = PLAY_NOW;
}
}
var trackUris = [];
switch (action) {
case PLAY_NOW:
@ -16,8 +23,6 @@ function playBrowsedTracks(action, trackIndex) {
trackUris.push(browseTracks[trackIndex].uri);
break;
case PLAY_ALL:
mopidy.tracklist.clear();
// Don't break, fall through.
case ADD_ALL_BOTTOM:
trackUris = getUris(browseTracks);
break;
@ -31,13 +36,6 @@ function playBrowsedTracks(action, trackIndex) {
}
};
// For radio streams we just add the selected URI.
// TODO: Why?
//if (isStreamUri(trackUri)) {
//mopidy.tracklist.add(null, null, trackUri);
//return false;
//}
switch (action) {
case PLAY_NOW:
case PLAY_NEXT:

View File

@ -284,7 +284,8 @@ function initSocketevents() {
mopidy.on("event:streamTitleChanged", function(data) {
songdata.track.name = data["title"];
setSongInfo(songdata)
console.log(songdata.track.name);
setSongInfo(songdata);
});
}