small changes

This commit is contained in:
woutervanwijk 2014-03-08 00:37:44 +01:00
parent e40032d17c
commit 240be7dc9a
3 changed files with 21 additions and 15 deletions

View File

@ -11,7 +11,6 @@ function playBrowsedTracks(addtoqueue, trackid) {
var selected = 0, counter = 0;
//only add one station for dirble, otherwise add all tracks
if (isRadioUri(trackid)) {
alert(trackid);
mopidy.tracklist.add(null, null, trackid);
} else {
//add all items in the playlist

View File

@ -150,11 +150,18 @@ function albumTracksToTable(pl, target, uri) {
}
function renderSongLi(song, liID, uri, playlistType){
var name;
if (!song.name || song.name == '') {
name = data.uri.split('/');
name = decodeURI(name[name.length - 1]);
} else {
name = song.name;
}
songLi = '<li class="song albumli" id="' + liID + '">' +
'<a href="#" class="moreBtn" onclick="return popupTracks(event, \'' + uri + '\',\'' + song.uri + '\');">' +
'<i class="fa fa-ellipsis-vertical"></i>' +
'</a>' +'<a href="#" onclick="return ' + playlistType + '(\'' + song.uri + '\',\'' + uri + '\');">' +
'<h1 class="trackname">'+song.name+'</h1>' +
'<h1 class="trackname">'+ name + '</h1>' +
'</a>' +
'</li>';
@ -188,14 +195,13 @@ function resultsToTables(results, target, uri) {
if (i < length - 1) {
nexturi = results[i + 1].album.uri;
}
//console.log(results[i]);
if (!results[i].album || (results[i].length == -1)) {
var name = results[i].name || results[i].uri;
html += '<li class="albumli"><a href="#"><h1>' + name + ' [Stream]</h1></a></li>';
newalbum = [];
nexturi = '';
} else {
if (results[i].album.uri != nexturi) {
if (results[i].album.uri && (results[i].album.uri != nexturi)) {
tableid = 'art' + i;
//render differently if only one track in the album
if ( newalbum.length == 1 ) {
@ -226,9 +232,12 @@ function resultsToTables(results, target, uri) {
newalbum = [];
} else {
html += '<li class="albumdivider">';
html += '<a href="#" onclick="return showAlbum(\'' + results[i].album.uri + '\');"><img id="' +
targetmin + '-cover-' + i + '" class="artistcover" width="30" height="30" /><h1>' + results[i].album.name + '</h1><p>';
if ( results[i].album.uri && results[i].album.name) {
html += '<li class="albumdivider">';
html += '<a href="#" onclick="return showAlbum(\'' + results[i].album.uri + '\');"><img id="' +
targetmin + '-cover-' + i + '" class="artistcover" width="30" height="30" /><h1>' + results[i].album.name + '</h1><p>';
}
console.log(i);
if (results[i].album.artists) {
for (j = 0; j < results[i].album.artists.length; j++) {
html += results[i].album.artists[j].name;

View File

@ -77,11 +77,11 @@ function resizeMb() {
}
function setSongInfo(data) {
if (!data || (songdata == data) ) { return; }
if (data.name == '') {
// data.name = data.uri;
return;
if (!data.name || data.name == '') {
var name = data.uri.split('/');
data.name = decodeURI(name[name.length - 1]);
};
if (!data || (songdata == data) ) { return; }
//update styles of listviews
$('#currenttable li').each(function() {
@ -118,9 +118,6 @@ function setSongInfo(data) {
});
if (data.name && (songdata.name == data.name)) {
return;
}
songdata = data;
artistshtml = '';
artiststext = '';
@ -133,6 +130,7 @@ function setSongInfo(data) {
}
};
}
console.log(data);
$("#modalname").html(data.name);
@ -163,7 +161,7 @@ function setSongInfo(data) {
arttmp = artistshtml;
}
if (data.album) {
if (data.album && data.album.name) {
$("#modalalbum").html('<a href="#" onclick="return showAlbum(\'' + data.album.uri + '\');">' + data.album.name + '</a>');
getCover(artiststext, data.album.name, '#infocover, #controlspopupimage', 'extralarge');
} else {