mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00: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
2 changed files with 13 additions and 14 deletions
|
@ -370,18 +370,8 @@ import 'emby-playstatebutton';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let showArtist = options.artist === true;
|
if (options.artist) {
|
||||||
const artistItems = item.ArtistItems;
|
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') {
|
if (artistItems && item.Type !== 'MusicAlbum') {
|
||||||
textlines.push(artistItems.map(a => {
|
textlines.push(artistItems.map(a => {
|
||||||
return a.Name;
|
return a.Name;
|
||||||
|
|
|
@ -1337,16 +1337,25 @@ function renderChildren(page, item) {
|
||||||
const childrenItemsContainer = page.querySelector('.childrenItemsContainer');
|
const childrenItemsContainer = page.querySelector('.childrenItemsContainer');
|
||||||
|
|
||||||
if (item.Type == 'MusicAlbum') {
|
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({
|
html = listView.getListViewHtml({
|
||||||
items: result.Items,
|
items: result.Items,
|
||||||
smallIcon: true,
|
smallIcon: true,
|
||||||
showIndex: true,
|
showIndex: new Set(discNumbers).size > 1 || (discNumbers.length >= 1 && discNumbers[0] > 1),
|
||||||
index: 'disc',
|
index: 'disc',
|
||||||
showIndexNumberLeft: true,
|
showIndexNumberLeft: true,
|
||||||
playFromHere: true,
|
playFromHere: true,
|
||||||
action: 'playallfromhere',
|
action: 'playallfromhere',
|
||||||
image: false,
|
image: false,
|
||||||
artist: 'auto',
|
artist: showArtist,
|
||||||
containerAlbumArtists: item.AlbumArtists
|
containerAlbumArtists: item.AlbumArtists
|
||||||
});
|
});
|
||||||
isList = true;
|
isList = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue