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

@ -173,6 +173,10 @@
var dataElement = dom.parentWithAttribute(elem, 'data-id'); var dataElement = dom.parentWithAttribute(elem, 'data-id');
if (!dataElement) {
return;
}
var id = dataElement.getAttribute('data-id'); var id = dataElement.getAttribute('data-id');
var type = dataElement.getAttribute('data-type'); var type = dataElement.getAttribute('data-type');

View File

@ -74,7 +74,7 @@
<h1> <h1>
${HeaderNextUp} ${HeaderNextUp}
</h1> </h1>
<div is="emby-itemscontainer" class="smallItemsContainer nextUpItems"></div> <div is="emby-itemscontainer" class="smallItemsContainer nextUpItems" is="emby-itemscontainer"></div>
</div> </div>
<div id="childrenCollapsible" class="hide detailSection"> <div id="childrenCollapsible" class="hide detailSection">
<h1 class="childrenSectionHeader"> <h1 class="childrenSectionHeader">
@ -88,7 +88,7 @@
<h1> <h1>
${HeaderAdditionalParts} ${HeaderAdditionalParts}
</h1> </h1>
<div id="additionalPartsContent" class="smallItemsContainer"></div> <div id="additionalPartsContent" class="smallItemsContainer" is="emby-itemscontainer"></div>
</div> </div>
<div id="castCollapsible" class="detailSection hide"> <div id="castCollapsible" class="detailSection hide">
<h1 id="peopleHeader"> <h1 id="peopleHeader">
@ -110,13 +110,17 @@
<h1> <h1>
${HeaderSpecialFeatures} ${HeaderSpecialFeatures}
</h1> </h1>
<div id="specialsContent" class="smallItemsContainer"></div> <div id="specialsContent" class="smallItemsContainer" is="emby-itemscontainer"></div>
</div> </div>
<div id="musicVideosCollapsible" class="detailSection hide"> <div id="musicVideosCollapsible" class="detailSection hide">
<h1> <h1>
${HeaderMusicVideos} ${HeaderMusicVideos}
</h1> </h1>
<div id="musicVideosContent" class="smallItemsContainer"></div> <div id="musicVideosContent" class="smallItemsContainer" is="emby-itemscontainer"></div>
</div>
<div id="moreFromSection" class="detailSection hide">
<h1 class="moreFromHeader"></h1>
<div id="moreFromItems"></div>
</div> </div>
<div id="similarCollapsible" class="detailSection hide"> <div id="similarCollapsible" class="detailSection hide">
<h1 class="similiarHeader"></h1> <h1 class="similiarHeader"></h1>
@ -176,7 +180,7 @@
<h1> <h1>
${HeaderThemeVideos} ${HeaderThemeVideos}
</h1> </h1>
<div id="themeVideosContent" class="smallItemsContainer"></div> <div id="themeVideosContent" class="smallItemsContainer" is="emby-itemscontainer"></div>
</div> </div>
<div class="detailSection audioVideoMediaInfo hide"> <div class="detailSection audioVideoMediaInfo hide">

View File

@ -442,6 +442,7 @@
function renderDetails(page, item, context, isStatic) { function renderDetails(page, item, context, isStatic) {
renderSimilarItems(page, item, context); renderSimilarItems(page, item, context);
renderMoreFromItems(page, item);
if (!isStatic) { if (!isStatic) {
renderSiblingLinks(page, item, context); renderSiblingLinks(page, item, context);
@ -721,6 +722,63 @@
return enableScrollX() ? 'overflowBackdrop' : 'detailPage169'; 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) { function renderSimilarItems(page, item, context) {
var similarCollapsible = page.querySelector('#similarCollapsible'); var similarCollapsible = page.querySelector('#similarCollapsible');
@ -751,8 +809,6 @@
ApiClient.getSimilarItems(item.Id, options).then(function (result) { ApiClient.getSimilarItems(item.Id, options).then(function (result) {
var similarCollapsible = page.querySelector('#similarCollapsible');
if (!result.Items.length) { if (!result.Items.length) {
similarCollapsible.classList.add('hide'); similarCollapsible.classList.add('hide');
@ -775,7 +831,6 @@
showParentTitle: item.Type == "MusicAlbum", showParentTitle: item.Type == "MusicAlbum",
centerText: true, centerText: true,
showTitle: item.Type == "MusicAlbum" || item.Type == "Game" || item.Type == "MusicArtist", showTitle: item.Type == "MusicAlbum" || item.Type == "Game" || item.Type == "MusicArtist",
borderless: item.Type == "Game",
context: context, context: context,
lazy: true, lazy: true,
showDetailsMenu: true, showDetailsMenu: true,

View File

@ -2380,5 +2380,6 @@
"OptionUseSystemInstalledVersion": "Use system installed version", "OptionUseSystemInstalledVersion": "Use system installed version",
"OptionUseMyCustomVersion": "Use a custom version", "OptionUseMyCustomVersion": "Use a custom version",
"FFmpegSavePathNotFound": "We're unable to locate FFmpeg using the path you've entered. FFprobe is also required and must exist in the same folder. These components are normally bundled together in the same download. Please check the path and try again.", "FFmpegSavePathNotFound": "We're unable to locate FFmpeg using the path you've entered. FFprobe is also required and must exist in the same folder. These components are normally bundled together in the same download. Please check the path and try again.",
"XmlTvPremiere": "By default, Emby will import {0} hours of guide data. Importing unlimited data requires an active Emby Premiere subscription." "XmlTvPremiere": "By default, Emby will import {0} hours of guide data. Importing unlimited data requires an active Emby Premiere subscription.",
"MoreFromValue": "More from {0}"
} }