mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-08-06 22:27:07 +02:00
Alternate solution to #7843 without extra prop
This commit is contained in:
parent
d318010c67
commit
bfa8c80d76
@ -1869,8 +1869,14 @@ namespace Emby.Server.Implementations.Library
|
|||||||
var outdated = forceUpdate
|
var outdated = forceUpdate
|
||||||
? item.ImageInfos.Where(i => i.Path is not null).ToArray()
|
? item.ImageInfos.Where(i => i.Path is not null).ToArray()
|
||||||
: item.ImageInfos.Where(ImageNeedsRefresh).ToArray();
|
: item.ImageInfos.Where(ImageNeedsRefresh).ToArray();
|
||||||
// Skip image processing if current or live tv source
|
|
||||||
if (outdated.Length == 0 || item.SourceType != SourceType.Library)
|
var parentItem = item.GetParent();
|
||||||
|
var isLiveTvShow = item.SourceType != SourceType.Library &&
|
||||||
|
parentItem is not null &&
|
||||||
|
parentItem.SourceType != SourceType.Library; // not a channel
|
||||||
|
|
||||||
|
// Skip image processing if current or live tv show
|
||||||
|
if (outdated.Length == 0 || isLiveTvShow)
|
||||||
{
|
{
|
||||||
RegisterItem(item);
|
RegisterItem(item);
|
||||||
return;
|
return;
|
||||||
|
@ -432,14 +432,19 @@ public class GuideManager : IGuideManager
|
|||||||
|
|
||||||
item.Name = channelInfo.Name;
|
item.Name = channelInfo.Name;
|
||||||
|
|
||||||
if (!item.HasImage(ImageType.Primary))
|
var currentPrimary = item.GetImageInfo(ImageType.Primary, 0);
|
||||||
|
var imageUrlIsNull = string.IsNullOrWhiteSpace(channelInfo.ImageUrl);
|
||||||
|
|
||||||
|
// Update channel image if image URL has changed
|
||||||
|
if (currentPrimary is null
|
||||||
|
|| (!imageUrlIsNull && currentPrimary.Path != channelInfo.ImageUrl))
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrWhiteSpace(channelInfo.ImagePath))
|
if (!string.IsNullOrWhiteSpace(channelInfo.ImagePath))
|
||||||
{
|
{
|
||||||
item.SetImagePath(ImageType.Primary, channelInfo.ImagePath);
|
item.SetImagePath(ImageType.Primary, channelInfo.ImagePath);
|
||||||
forceUpdate = true;
|
forceUpdate = true;
|
||||||
}
|
}
|
||||||
else if (!string.IsNullOrWhiteSpace(channelInfo.ImageUrl))
|
else if (!imageUrlIsNull)
|
||||||
{
|
{
|
||||||
item.SetImagePath(ImageType.Primary, channelInfo.ImageUrl);
|
item.SetImagePath(ImageType.Primary, channelInfo.ImageUrl);
|
||||||
forceUpdate = true;
|
forceUpdate = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user