mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #3628 from thornbill/actually-fix-artist-albums
(cherry picked from commit d606a2aad5
)
Signed-off-by: Joshua Boniface <joshua@boniface.me>
This commit is contained in:
parent
39dccfcd70
commit
34b2018610
2 changed files with 9 additions and 3 deletions
|
@ -1182,9 +1182,9 @@ function renderMoreFromArtist(view, item, apiClient) {
|
||||||
};
|
};
|
||||||
|
|
||||||
if (item.Type === 'MusicArtist') {
|
if (item.Type === 'MusicArtist') {
|
||||||
query.AlbumArtistIds = item.Id;
|
query.ContributingArtistIds = item.Id;
|
||||||
} else {
|
} else {
|
||||||
query.AlbumArtistIds = item.AlbumArtists[0].Id;
|
query.ContributingArtistIds = item.AlbumArtists.map(artist => artist.Id).join(',');
|
||||||
}
|
}
|
||||||
|
|
||||||
apiClient.getItems(apiClient.getCurrentUserId(), query).then(function (result) {
|
apiClient.getItems(apiClient.getCurrentUserId(), query).then(function (result) {
|
||||||
|
|
|
@ -265,6 +265,12 @@ function renderSection(page, item, element, type) {
|
||||||
function loadItems(element, item, type, query, listOptions) {
|
function loadItems(element, item, type, query, listOptions) {
|
||||||
query = getQuery(query, item);
|
query = getQuery(query, item);
|
||||||
getItemsFunction(query, item)(query.StartIndex, query.Limit, query.Fields).then(function (result) {
|
getItemsFunction(query, item)(query.StartIndex, query.Limit, query.Fields).then(function (result) {
|
||||||
|
// If results are empty, hide the section
|
||||||
|
if (!result.Items?.length) {
|
||||||
|
element.classList.add('hide');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let html = '';
|
let html = '';
|
||||||
|
|
||||||
if (query.Limit && result.TotalRecordCount > query.Limit) {
|
if (query.Limit && result.TotalRecordCount > query.Limit) {
|
||||||
|
@ -327,7 +333,7 @@ function addCurrentItemToQuery(query, item) {
|
||||||
} else if (item.Type === 'Studio') {
|
} else if (item.Type === 'Studio') {
|
||||||
query.StudioIds = item.Id;
|
query.StudioIds = item.Id;
|
||||||
} else if (item.Type === 'MusicArtist') {
|
} else if (item.Type === 'MusicArtist') {
|
||||||
query.ArtistIds = item.Id;
|
query.AlbumArtistIds = item.Id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue