Add Music Videos under MusicArtist view
local adapts Added Music Videos View under MusicArtist view simplified fix Delete VSWorkspaceState.json Delete read.lock removed unwanted changes removed unwanted line changes applied revert parameter usage
This commit is contained in:
parent
478f81fecf
commit
979e7aa659
1 changed files with 12 additions and 5 deletions
|
@ -852,7 +852,7 @@ function setInitialCollapsibleState(page, item, apiClient, context, user) {
|
|||
page.querySelector('#additionalPartsCollapsible').classList.add('hide');
|
||||
}
|
||||
|
||||
if (item.Type == 'MusicAlbum') {
|
||||
if (item.Type == 'MusicAlbum' || item.Type == 'MusicArtist') {
|
||||
renderMusicVideos(page, item, user);
|
||||
} else {
|
||||
page.querySelector('#musicVideosCollapsible').classList.add('hide');
|
||||
|
@ -1719,14 +1719,21 @@ function renderCollectionItemType(page, parentItem, type, items) {
|
|||
}
|
||||
|
||||
function renderMusicVideos(page, item, user) {
|
||||
ServerConnections.getApiClient(item.ServerId).getItems(user.Id, {
|
||||
const request = {
|
||||
SortBy: 'SortName',
|
||||
SortOrder: 'Ascending',
|
||||
IncludeItemTypes: 'MusicVideo',
|
||||
Recursive: true,
|
||||
Fields: 'PrimaryImageAspectRatio,BasicSyncInfo,CanDelete,MediaSourceCount',
|
||||
AlbumIds: item.Id
|
||||
}).then(function (result) {
|
||||
Fields: 'PrimaryImageAspectRatio,BasicSyncInfo,CanDelete,MediaSourceCount'
|
||||
};
|
||||
|
||||
if (item.Type == 'MusicAlbum') {
|
||||
request.AlbumIds = item.Id;
|
||||
} else {
|
||||
request.ArtistIds = item.Id;
|
||||
}
|
||||
|
||||
ServerConnections.getApiClient(item.ServerId).getItems(user.Id, request).then(function (result) {
|
||||
if (result.Items.length) {
|
||||
page.querySelector('#musicVideosCollapsible').classList.remove('hide');
|
||||
const musicVideosContent = page.querySelector('#musicVideosContent');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue