mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-09 01:08:45 +01:00
Merge pull request #10841 from Bond-009/LiveTvImageFix
Refresh live TV channel image when remapped (alt #7843) (fixes #7834)
This commit is contained in:
@@ -2450,8 +2450,14 @@ namespace Emby.Server.Implementations.Library
|
||||
var outdated = forceUpdate
|
||||
? item.ImageInfos.Where(i => i.Path is not null).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);
|
||||
return;
|
||||
|
||||
@@ -448,14 +448,19 @@ public class GuideManager : IGuideManager
|
||||
|
||||
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 && !string.Equals(currentPrimary.Path, channelInfo.ImageUrl, StringComparison.Ordinal)))
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(channelInfo.ImagePath))
|
||||
{
|
||||
item.SetImagePath(ImageType.Primary, channelInfo.ImagePath);
|
||||
forceUpdate = true;
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(channelInfo.ImageUrl))
|
||||
else if (!imageUrlIsNull)
|
||||
{
|
||||
item.SetImagePath(ImageType.Primary, channelInfo.ImageUrl);
|
||||
forceUpdate = true;
|
||||
|
||||
Reference in New Issue
Block a user