1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

display more from artist on album page

This commit is contained in:
Luke Pulverenti 2016-07-22 01:38:01 -04:00
parent 707725bb93
commit 6dfbdaa13a
4 changed files with 73 additions and 9 deletions

View file

@ -442,6 +442,7 @@
function renderDetails(page, item, context, isStatic) {
renderSimilarItems(page, item, context);
renderMoreFromItems(page, item);
if (!isStatic) {
renderSiblingLinks(page, item, context);
@ -721,6 +722,63 @@
return enableScrollX() ? 'overflowBackdrop' : 'detailPage169';
}
function renderMoreFromItems(page, item) {
var moreFromSection = page.querySelector('#moreFromSection');
if (!moreFromSection) {
return;
}
if (item.Type != 'MusicAlbum' || !item.AlbumArtists || !item.AlbumArtists.length) {
moreFromSection.classList.add('hide');
return;
}
ApiClient.getItems(Dashboard.getCurrentUserId(), {
IncludeItemTypes: "MusicAlbum",
ArtistIds: item.AlbumArtists[0].Id,
Recursive: true,
ExcludeItemIds: item.Id
}).then(function(result) {
if (!result.Items.length) {
moreFromSection.classList.add('hide');
return;
}
moreFromSection.classList.remove('hide');
moreFromSection.querySelector('.moreFromHeader').innerHTML = Globalize.translate('MoreFromValue', item.AlbumArtists[0].Name);
var html = '';
if (enableScrollX()) {
html += '<div is="emby-itemscontainer" class="hiddenScrollX itemsContainer">';
} else {
html += '<div is="emby-itemscontainer" class="itemsContainer">';
}
var shape = item.Type == "MusicAlbum" || item.Type == "MusicArtist" ? getSquareShape() : getPortraitShape();
html += LibraryBrowser.getPosterViewHtml({
items: result.Items,
shape: shape,
showParentTitle: item.Type == "MusicAlbum",
centerText: true,
showTitle: item.Type == "MusicAlbum" || item.Type == "Game" || item.Type == "MusicArtist",
coverImage: item.Type == "MusicAlbum" || item.Type == "MusicArtist",
overlayPlayButton: true
});
html += '</div>';
var similarContent = page.querySelector('#moreFromItems');
similarContent.innerHTML = html;
ImageLoader.lazyChildren(similarContent);
});
}
function renderSimilarItems(page, item, context) {
var similarCollapsible = page.querySelector('#similarCollapsible');
@ -751,8 +809,6 @@
ApiClient.getSimilarItems(item.Id, options).then(function (result) {
var similarCollapsible = page.querySelector('#similarCollapsible');
if (!result.Items.length) {
similarCollapsible.classList.add('hide');
@ -775,7 +831,6 @@
showParentTitle: item.Type == "MusicAlbum",
centerText: true,
showTitle: item.Type == "MusicAlbum" || item.Type == "Game" || item.Type == "MusicArtist",
borderless: item.Type == "Game",
context: context,
lazy: true,
showDetailsMenu: true,