mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge 8f9ef246eb
into 7d84185d0e
This commit is contained in:
commit
1d8a9945d7
1 changed files with 24 additions and 12 deletions
|
@ -232,7 +232,7 @@ function Guide(options) {
|
|||
channelQuery.Limit = channelLimit;
|
||||
channelQuery.AddCurrentProgram = false;
|
||||
channelQuery.EnableUserData = false;
|
||||
channelQuery.EnableImageTypes = 'Primary';
|
||||
channelQuery.EnableImageTypes = 'Primary,Logo';
|
||||
|
||||
const categories = self.categoryOptions.categories || [];
|
||||
const displayMovieContent = !categories.length || categories.indexOf('movies') !== -1;
|
||||
|
@ -591,8 +591,6 @@ function Guide(options) {
|
|||
let html = '';
|
||||
|
||||
for (const channel of channels) {
|
||||
const hasChannelImage = channel.ImageTags.Primary;
|
||||
|
||||
let cssClass = 'guide-channelHeaderCell itemAction';
|
||||
|
||||
if (layoutManager.tv) {
|
||||
|
@ -609,21 +607,16 @@ function Guide(options) {
|
|||
|
||||
html += '<button title="' + escapeHtml(title.join(' ')) + '" type="button" class="' + cssClass + '"' + ' data-action="link" data-isfolder="' + channel.IsFolder + '" data-id="' + channel.Id + '" data-serverid="' + channel.ServerId + '" data-type="' + channel.Type + '">';
|
||||
|
||||
if (hasChannelImage) {
|
||||
const url = apiClient.getScaledImageUrl(channel.Id, {
|
||||
maxHeight: 220,
|
||||
tag: channel.ImageTags.Primary,
|
||||
type: 'Primary'
|
||||
});
|
||||
|
||||
html += '<div class="guideChannelImage lazy" data-src="' + url + '"></div>';
|
||||
const channelImageUrl = renderChannelImageUrl(channel, apiClient);
|
||||
if (channelImageUrl) {
|
||||
html += '<div class="guideChannelImage lazy" data-src="' + channelImageUrl + '"></div>';
|
||||
}
|
||||
|
||||
if (channel.ChannelNumber) {
|
||||
html += '<h3 class="guideChannelNumber">' + channel.ChannelNumber + '</h3>';
|
||||
}
|
||||
|
||||
if (!hasChannelImage && channel.Name) {
|
||||
if (!channelImageUrl && channel.Name) {
|
||||
html += '<div class="guideChannelName">' + escapeHtml(channel.Name) + '</div>';
|
||||
}
|
||||
|
||||
|
@ -635,6 +628,25 @@ function Guide(options) {
|
|||
imageLoader.lazyChildren(channelList);
|
||||
}
|
||||
|
||||
function renderChannelImageUrl(channel, apiClient) {
|
||||
const hasChannelLogo = channel.ImageTags.Logo;
|
||||
const hasChannelPrimary = channel.ImageTags.Primary;
|
||||
|
||||
if (!hasChannelLogo && !hasChannelPrimary) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const imgType = hasChannelLogo ? 'Logo' : 'Primary';
|
||||
const imgTag = hasChannelLogo ? channel.ImageTags.Logo : channel.ImageTags.Primary;
|
||||
const url = apiClient.getScaledImageUrl(channel.Id, {
|
||||
maxHeight: 220,
|
||||
tag: imgTag,
|
||||
type: imgType
|
||||
});
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
function renderPrograms(context, date, channels, programs, programOptions) {
|
||||
const listInfo = {
|
||||
startIndex: 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue