From 78d6af1c4f53c6065f7729f396562fc27017e0fe 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 123b3c3092cb..ceae82441803 100644 --- a/src/controllers/itemDetails/index.js +++ b/src/controllers/itemDetails/index.js @@ -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.
`; + 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(' - ') + '

'; }