From afd0111b94e0762bb346f9095999b7cae48cb80b Mon Sep 17 00:00:00 2001 From: AJ Date: Tue, 3 Oct 2023 11:52:50 -0400 Subject: [PATCH] Added condition to display concatenated text if artist count is over 10. Fixed #4228 --- src/controllers/itemDetails/index.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/controllers/itemDetails/index.js b/src/controllers/itemDetails/index.js index 99dbd8d2ea5..78584f7a92f 100644 --- a/src/controllers/itemDetails/index.js +++ b/src/controllers/itemDetails/index.js @@ -441,8 +441,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.
`; + if (layoutManager.mobile) { - html = '

' + parentNameHtml.join('
') + '

'; + if (artists.length > 10) { + html = '

' + newParentNameHtml + '

'; + } else { + html = '

' + parentNameHtml.join('
') + '

'; + } + } else if (artists.length > 10) { + html = '

' + newParentNameHtml + '

'; } else { html = '

' + parentNameHtml.join(' - ') + '

'; }