mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 02:48:19 -07:00
Merge pull request #1308 from bendardenne/artist-in-album-view
Revisit showing track artists in album view
This commit is contained in:
commit
c09e31d79f
@ -370,18 +370,8 @@ import 'emby-playstatebutton';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
let showArtist = options.artist === true;
|
||||
if (options.artist) {
|
||||
const artistItems = item.ArtistItems;
|
||||
|
||||
if (!showArtist && options.artist !== false) {
|
||||
if (!artistItems || !artistItems.length) {
|
||||
showArtist = true;
|
||||
} else if (artistItems.length > 1 || !containerAlbumArtistIds.includes(artistItems[0].Id)) {
|
||||
showArtist = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (showArtist) {
|
||||
if (artistItems && item.Type !== 'MusicAlbum') {
|
||||
textlines.push(artistItems.map(a => {
|
||||
return a.Name;
|
||||
|
@ -1337,16 +1337,25 @@ function renderChildren(page, item) {
|
||||
const childrenItemsContainer = page.querySelector('.childrenItemsContainer');
|
||||
|
||||
if (item.Type == 'MusicAlbum') {
|
||||
const equalSet = (arr1, arr2) => arr1.every(x => arr2.indexOf(x) !== -1) && arr1.length === arr2.length;
|
||||
let showArtist = false;
|
||||
for (const track of result.Items) {
|
||||
if (!equalSet(track.ArtistItems.map(x => x.Id), track.AlbumArtists.map(x => x.Id))) {
|
||||
showArtist = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
const discNumbers = result.Items.map(x => x.ParentIndexNumber);
|
||||
html = listView.getListViewHtml({
|
||||
items: result.Items,
|
||||
smallIcon: true,
|
||||
showIndex: true,
|
||||
showIndex: new Set(discNumbers).size > 1 || (discNumbers.length >= 1 && discNumbers[0] > 1),
|
||||
index: 'disc',
|
||||
showIndexNumberLeft: true,
|
||||
playFromHere: true,
|
||||
action: 'playallfromhere',
|
||||
image: false,
|
||||
artist: 'auto',
|
||||
artist: showArtist,
|
||||
containerAlbumArtists: item.AlbumArtists
|
||||
});
|
||||
isList = true;
|
||||
|
Loading…
Reference in New Issue
Block a user