Skip to content

Commit

Permalink
Update src/controllers/itemDetails/index.js
Browse files Browse the repository at this point in the history
Co-authored-by: Bill Thornton <thornbill@users.noreply.github.com>
  • Loading branch information
alfred-delacosta and thornbill committed Oct 24, 2023
1 parent ba2eee4 commit 937aa81
Showing 1 changed file with 11 additions and 19 deletions.
30 changes: 11 additions & 19 deletions src/controllers/itemDetails/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,25 +386,17 @@ function getArtistLinksHtml(artists, serverId, context) {
const html = [];
const numberOfArtists = artists.length;

if (numberOfArtists < 10) {
for (const artist of artists) {
const href = appRouter.getRouteUrl(artist, {
context: context,
itemType: 'MusicArtist',
serverId: serverId
});
html.push('<a style="color:inherit;" class="button-link" is="emby-linkbutton" href="' + href + '">' + escapeHtml(artist.Name) + '</a>');
}
} else {
for (let i = 0; i < 10; i++) {
const artist = artists[i];
const href = appRouter.getRouteUrl(artist, {
context: context,
itemType: 'MusicArtist',
serverId: serverId
});
html.push('<a style="color:inherit;" class="button-link" is="emby-linkbutton" href="' + href + '">' + escapeHtml(artist.Name) + '</a>');
}
for (let i = 0; i < Math.min(numberOfArtists, 10); i++) {
const artist = artists[i];
const href = appRouter.getRouteUrl(artist, {
context,
itemType: 'MusicArtist',
serverId
});
html.push('<a style="color:inherit;" class="button-link" is="emby-linkbutton" href="' + href + '">' + escapeHtml(artist.Name) + '</a>');
}

if (numberOfArtists > 10) {
const remainingNumberOfArtists = numberOfArtists - 10;
html.push(`${globalize.translate('AndOtherArtists', remainingNumberOfArtists)}`);
}
Expand Down

0 comments on commit 937aa81

Please sign in to comment.