Skip to content

Commit

Permalink
Simple attempt at adding song listing to artist page
Browse files Browse the repository at this point in the history
  • Loading branch information
theevilapplepie committed Dec 27, 2024
1 parent bdb1841 commit 0bb8613
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/components/listview/listview.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,9 @@ export function getListViewHtml(options) {
}).join(', '));
}
}
if (options.album && item.Type === 'Audio' && item.Album) {

Check failure on line 388 in src/components/listview/listview.js

View workflow job for this annotation

GitHub Actions / Quality checks 👌🧪 / Run lint 🕵️‍♂️

Multiple spaces found before '{'
textlines.push(item.Album);
}

if (item.Type === 'TvChannel' && item.CurrentProgram) {
textlines.push(itemHelper.getDisplayName(item.CurrentProgram));
Expand Down
50 changes: 44 additions & 6 deletions src/controllers/itemDetails/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ function setInitialCollapsibleState(page, item, apiClient, context, user) {

renderScenes(page, item);

if (item.SpecialFeatureCount > 0) {
if (item.SpecialFeatureCount > 0 || item.Type == 'MusicArtist') {
page.querySelector('#specialsCollapsible').classList.remove('hide');
renderSpecials(page, item, user);
} else {
Expand Down Expand Up @@ -1754,6 +1754,7 @@ function renderCollectionItemType(page, parentItem, type, items) {
}

function renderMusicVideos(page, item, user) {

Check failure on line 1756 in src/controllers/itemDetails/index.js

View workflow job for this annotation

GitHub Actions / Quality checks 👌🧪 / Run lint 🕵️‍♂️

Block must not be padded by blank lines

const request = {
SortBy: 'SortName',
SortOrder: 'Ascending',
Expand All @@ -1778,6 +1779,7 @@ function renderMusicVideos(page, item, user) {
page.querySelector('#musicVideosCollapsible').classList.add('hide');
}
});

Check failure on line 1781 in src/controllers/itemDetails/index.js

View workflow job for this annotation

GitHub Actions / Quality checks 👌🧪 / Run lint 🕵️‍♂️

Block must not be padded by blank lines

}

function renderAdditionalParts(page, item, user) {
Expand Down Expand Up @@ -1829,14 +1831,50 @@ function getVideosHtml(items) {
});
}

function renderSpecials(page, item, user) {
ServerConnections.getApiClient(item.ServerId).getSpecialFeatures(user.Id, item.Id).then(function (specials) {
const specialsContent = page.querySelector('#specialsContent');
specialsContent.innerHTML = getVideosHtml(specials);
imageLoader.lazyChildren(specialsContent);
function renderArtistTrackList(page, item, user) {
const request = {
SortBy: 'Name',
SortOrder: 'Ascending',
IncludeItemTypes: 'Audio',
Recursive: true,
ArtistIds: item.Id,

Check failure on line 1840 in src/controllers/itemDetails/index.js

View workflow job for this annotation

GitHub Actions / Quality checks 👌🧪 / Run lint 🕵️‍♂️

Unexpected trailing comma
};

ServerConnections.getApiClient(item.ServerId).getItems(user.Id, request).then(function (result) {
if (result.Items.length) {
page.querySelector('#specialsCollapsible').classList.remove('hide');
page.querySelector('#specialsCollapsible').classList.add('verticalSection-extrabottompadding');
page.querySelector('#specialsCollapsible>.sectionTitle').innerHTML = 'Songs'

Check failure on line 1847 in src/controllers/itemDetails/index.js

View workflow job for this annotation

GitHub Actions / Quality checks 👌🧪 / Run lint 🕵️‍♂️

Missing semicolon
const specialsContent = page.querySelector('#specialsContent');
specialsContent.classList.remove('itemsContainer');
specialsContent.innerHTML = listView.getListViewHtml({
items: result.Items,
smallIcon: true,
showIndexNumberLeft: false,
playFromHere: true,
action: 'play',
album: true,

Check failure on line 1856 in src/controllers/itemDetails/index.js

View workflow job for this annotation

GitHub Actions / Quality checks 👌🧪 / Run lint 🕵️‍♂️

Unexpected trailing comma
});
imageLoader.lazyChildren(specialsContent);
} else {
page.querySelector('#specialsCollapsible').classList.add('hide');
}
});
}


Check failure on line 1865 in src/controllers/itemDetails/index.js

View workflow job for this annotation

GitHub Actions / Quality checks 👌🧪 / Run lint 🕵️‍♂️

More than 1 blank line not allowed
function renderSpecials(page, item, user) {
if ( item.Type == 'MusicArtist' ) {
renderArtistTrackList(page, item, user);

Check failure on line 1868 in src/controllers/itemDetails/index.js

View workflow job for this annotation

GitHub Actions / Quality checks 👌🧪 / Run lint 🕵️‍♂️

Expected indentation of 8 spaces but found 6
} else {
ServerConnections.getApiClient(item.ServerId).getSpecialFeatures(user.Id, item.Id).then(function (specials) {

Check failure on line 1870 in src/controllers/itemDetails/index.js

View workflow job for this annotation

GitHub Actions / Quality checks 👌🧪 / Run lint 🕵️‍♂️

Expected indentation of 8 spaces but found 6
const specialsContent = page.querySelector('#specialsContent');

Check failure on line 1871 in src/controllers/itemDetails/index.js

View workflow job for this annotation

GitHub Actions / Quality checks 👌🧪 / Run lint 🕵️‍♂️

Expected indentation of 12 spaces but found 10
specialsContent.innerHTML = getVideosHtml(specials);
imageLoader.lazyChildren(specialsContent);
});
}
}

function renderCast(page, item, people) {
if (!people.length) {
page.querySelector('#castCollapsible').classList.add('hide');
Expand Down

0 comments on commit 0bb8613

Please sign in to comment.