diff --git a/src/components/listview/listview.js b/src/components/listview/listview.js index 8240ee047b5..f3a9a5b6882 100644 --- a/src/components/listview/listview.js +++ b/src/components/listview/listview.js @@ -385,6 +385,9 @@ export function getListViewHtml(options) { }).join(', ')); } } + if (options.album && item.Type === 'Audio' && item.Album) { + textlines.push(item.Album); + } if (item.Type === 'TvChannel' && item.CurrentProgram) { textlines.push(itemHelper.getDisplayName(item.CurrentProgram)); diff --git a/src/controllers/itemDetails/index.js b/src/controllers/itemDetails/index.js index bdb5a9fe08f..1c01c45aea0 100644 --- a/src/controllers/itemDetails/index.js +++ b/src/controllers/itemDetails/index.js @@ -826,7 +826,7 @@ function setInitialCollapsibleState(page, item, apiClient, context, user) { renderScenes(page, item); - if (item.SpecialFeatureCount > 0) { + if (item.SpecialFeatureCount > 0 || item.Type === 'MusicArtist') { page.querySelector('#specialsCollapsible').classList.remove('hide'); renderSpecials(page, item, user); } else { @@ -1832,14 +1832,49 @@ function getVideosHtml(items) { }); } -function renderSpecials(page, item, user) { - ServerConnections.getApiClient(item.ServerId).getSpecialFeatures(user.Id, item.Id).then(function (specials) { - const specialsContent = page.querySelector('#specialsContent'); - specialsContent.innerHTML = getVideosHtml(specials); - imageLoader.lazyChildren(specialsContent); +function renderArtistTrackList(page, item, user) { + const request = { + SortBy: 'Name', + SortOrder: 'Ascending', + IncludeItemTypes: 'Audio', + Recursive: true, + ArtistIds: item.Id + }; + + ServerConnections.getApiClient(item.ServerId).getItems(user.Id, request).then(function (result) { + if (result.Items.length) { + page.querySelector('#specialsCollapsible').classList.remove('hide'); + page.querySelector('#specialsCollapsible').classList.add('verticalSection-extrabottompadding'); + page.querySelector('#specialsCollapsible>.sectionTitle').innerHTML = 'Songs'; + const specialsContent = page.querySelector('#specialsContent'); + specialsContent.classList.remove('itemsContainer'); + specialsContent.innerHTML = listView.getListViewHtml({ + items: result.Items, + smallIcon: true, + showIndexNumberLeft: false, + playFromHere: true, + action: 'play', + album: true + }); + imageLoader.lazyChildren(specialsContent); + } else { + page.querySelector('#specialsCollapsible').classList.add('hide'); + } }); } +function renderSpecials(page, item, user) { + if ( item.Type === 'MusicArtist' ) { + renderArtistTrackList(page, item, user); + } else { + ServerConnections.getApiClient(item.ServerId).getSpecialFeatures(user.Id, item.Id).then(function (specials) { + const specialsContent = page.querySelector('#specialsContent'); + specialsContent.innerHTML = getVideosHtml(specials); + imageLoader.lazyChildren(specialsContent); + }); + } +} + function renderCast(page, item, people) { if (!people.length) { page.querySelector('#castCollapsible').classList.add('hide');