Skip to content

Commit

Permalink
Merge pull request #4196 from mark5231/master
Browse files Browse the repository at this point in the history
Show production studio
  • Loading branch information
thornbill authored Feb 7, 2023
2 parents 178a077 + 392cef8 commit 44edc3d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/controllers/itemDetails/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ <h3 class="tagline"></h3>
<div class="writersLabel label"></div>
<div class="writers content focuscontainer-x"></div>
</div>

<div class="detailsGroupItem studiosGroup hide">
<div class="studiosLabel label"></div>
<div class="studios content focuscontainer-x"></div>
</div>
</div>
</div>
</div>
Expand Down
24 changes: 24 additions & 0 deletions src/controllers/itemDetails/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1031,6 +1031,29 @@ function renderDirector(page, item, context) {
}
}

function renderStudio(page, item, context) {
const studios = item.Studios || [];

const html = studios.map(function (studio) {
return '<a style="color:inherit;" class="button-link" is="emby-linkbutton" href="' + appRouter.getRouteUrl({
Name: studio.Name,
Type: 'Studio',
ServerId: item.ServerId,
Id: studio.Id
}, {
context: context
}) + '">' + escapeHtml(studio.Name) + '</a>';
}).join(', ');

const studiosLabel = page.querySelector('.studiosLabel');
studiosLabel.innerText = globalize.translate(studios.length > 1 ? 'Studios' : 'Studio');
const studiosValue = page.querySelector('.studios');
studiosValue.innerHTML = html;

const studiosGroup = page.querySelector('.studiosGroup');
studiosGroup.classList.toggle('hide', !studios.length);
}

function renderMiscInfo(page, item) {
const primaryItemMiscInfo = page.querySelectorAll('.itemMiscInfo-primary');

Expand Down Expand Up @@ -1079,6 +1102,7 @@ function renderDetails(page, item, apiClient, context, isStatic) {
renderMoreFromSeason(page, item, apiClient);
renderMoreFromArtist(page, item, apiClient);
renderDirector(page, item, context);
renderStudio(page, item, context);
renderWriter(page, item, context);
renderGenres(page, item, context);
renderChannelGuide(page, apiClient, item);
Expand Down

0 comments on commit 44edc3d

Please sign in to comment.