Skip to content

Commit

Permalink
Added condition to display concatenated text if artist count is over …
Browse files Browse the repository at this point in the history
…10. Fixed jellyfin#4228
  • Loading branch information
AJ authored and thornbill committed Oct 24, 2023
1 parent 167a13d commit 78d6af1
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/controllers/itemDetails/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,20 @@ function renderName(item, container, context) {
if (parentNameHtml.length) {
if (parentNameLast) {
// Music
// Determine if there are over 10 artists in the album. If so, concat with 'and X others.'
const artists = parentNameHtml[0].split(' / ');
const otherArtistCount = artists.length - 10;
let newParentNameHtml = artists.slice(0, 10).join(' / ');
newParentNameHtml = `${newParentNameHtml} and ${otherArtistCount} other artists.</br>`;

if (layoutManager.mobile) {
html = '<h3 class="parentName musicParentName">' + parentNameHtml.join('</br>') + '</h3>';
if (artists.length > 10) {
html = '<h3 class="parentName musicParentName ">' + newParentNameHtml + '</h3>';
} else {
html = '<h3 class="parentName musicParentName">' + parentNameHtml.join('</br>') + '</h3>';
}
} else if (artists.length > 10) {
html = '<h3 class="parentName musicParentName">' + newParentNameHtml + '</h3>';
} else {
html = '<h3 class="parentName musicParentName focuscontainer-x">' + parentNameHtml.join(' - ') + '</h3>';
}
Expand Down

0 comments on commit 78d6af1

Please sign in to comment.