fixes #520 - Support multiple artists per audio track
This commit is contained in:
parent
ee25e54186
commit
e6bb8d236f
3 changed files with 51 additions and 9 deletions
|
@ -238,8 +238,8 @@
|
|||
$('#players', page).hide();
|
||||
}
|
||||
|
||||
if ((item.Type == "Audio" || item.Type == "MusicVideo") && item.Artists && item.Artists.length) {
|
||||
$('#artist', page).show().html('Artist: <a class="textlink" href="itembynamedetails.html?context=music&artist=' + ApiClient.encodeName(item.Artists[0]) + '">' + item.Artists[0] + '</a>').trigger('create');
|
||||
if (item.Artists && item.Artists.length) {
|
||||
$('#artist', page).show().html(getArtistLinksHtml(item.Artists)).trigger('create');
|
||||
} else {
|
||||
$('#artist', page).hide();
|
||||
}
|
||||
|
@ -260,6 +260,30 @@
|
|||
$('.itemPath', page).hide();
|
||||
}
|
||||
}
|
||||
|
||||
function getArtistLinksHtml(artists) {
|
||||
|
||||
var html = [];
|
||||
|
||||
for (var i = 0, length = artists.length; i < length; i++) {
|
||||
|
||||
var artist = artists[i];
|
||||
|
||||
html.push('<a class="textlink" href="itembynamedetails.html?context=music&artist=' + ApiClient.encodeName(artist) + '">' + artist + '</a>');
|
||||
|
||||
}
|
||||
|
||||
html = html.join(' / ');
|
||||
|
||||
if (artists.length == 1) {
|
||||
return 'Artist: ' + html;
|
||||
}
|
||||
if (artists.length > 1) {
|
||||
return 'Artists: ' + html;
|
||||
}
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
function renderSoundtracks(page, item) {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue