1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Added artist list concatenation for albums that have over 10 artists (#4830)

* Added condition to display concatenated text if artist count is over 10. Fixed #4228

* Added string to strings.json. Used globalize.translate()

* Moved code to getArtistLinksHtml function

* Update src/controllers/itemDetails/index.js

Co-authored-by: Bill Thornton <thornbill@users.noreply.github.com>

* Simplify appending other artists string

* Update src/controllers/itemDetails/index.js

Co-authored-by: Bill Thornton <thornbill@users.noreply.github.com>

* Update src/controllers/itemDetails/index.js

Co-authored-by: felix920506 <felix920506@gmail.com>

* Update src/strings/en-us.json

Co-authored-by: felix920506 <felix920506@gmail.com>

---------

Co-authored-by: AJ <ajdlc@protonmail.com>
Co-authored-by: Bill Thornton <thornbill@users.noreply.github.com>
Co-authored-by: felix920506 <felix920506@gmail.com>
This commit is contained in:
alfred-delacosta 2024-08-15 14:06:43 -04:00 committed by GitHub
parent 32354b3a37
commit 1172d9a2b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 4 deletions

View file

@ -386,17 +386,25 @@ function reloadUserDataButtons(page, item) {
function getArtistLinksHtml(artists, serverId, context) {
const html = [];
const numberOfArtists = artists.length;
for (const artist of artists) {
for (let i = 0; i < Math.min(numberOfArtists, 10); i++) {
const artist = artists[i];
const href = appRouter.getRouteUrl(artist, {
context: context,
context,
itemType: 'MusicArtist',
serverId: serverId
serverId
});
html.push('<a style="color:inherit;" class="button-link" is="emby-linkbutton" href="' + href + '">' + escapeHtml(artist.Name) + '</a>');
}
return html.join(' / ');
let fullHtml = html.join(' / ');
if (numberOfArtists > 10) {
fullHtml = globalize.translate('AndOtherArtists', fullHtml, numberOfArtists - 10);
}
return fullHtml;
}
/**