1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
This commit is contained in:
Robert Down RN 2025-03-30 11:01:15 -04:00 committed by GitHub
commit 1d8a9945d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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