aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Sommerfeld <kai.sommerfeld@gmx.com>2021-05-14 15:08:44 +0200
committerGitHub <noreply@github.com>2021-05-14 15:08:44 +0200
commit3bffdaf848559a7a53e0f6fef956891a0ac8e496 (patch)
tree1f3b7380d82f731bb95a83116c9d6e2f06653736
parent5db2d9377e0314f9bdb715b36a63193c660b3157 (diff)
parent998fee14860d90cd1f1599f9e60dbad3ffbae6ce (diff)
Merge pull request #19742 from ksooo/fileitem-add-more-icon-art-fallbacks
[PVR] CFileItem: Add fallbacks to channel icon and default images to …
-rw-r--r--xbmc/FileItem.cpp25
1 files changed, 22 insertions, 3 deletions
diff --git a/xbmc/FileItem.cpp b/xbmc/FileItem.cpp
index c7f8c128ff..45dba74a4b 100644
--- a/xbmc/FileItem.cpp
+++ b/xbmc/FileItem.cpp
@@ -176,11 +176,18 @@ CFileItem::CFileItem(const std::shared_ptr<PVR::CPVREpgInfoTag>& tag,
if (!tag->Icon().empty())
SetArt("icon", tag->Icon());
- else if (groupMember)
+ else
{
- const std::shared_ptr<CPVRChannel> channel = groupMember->Channel();
+ std::shared_ptr<CPVRChannel> channel;
+ if (groupMember)
+ channel = groupMember->Channel();
+
if (channel && !channel->IconPath().empty())
SetArt("icon", channel->IconPath());
+ else if (tag->IsRadio())
+ SetArt("icon", "DefaultAudio.png");
+ else
+ SetArt("icon", "DefaultTVShows.png");
}
FillMusicInfoTag(groupMember, tag);
@@ -229,8 +236,16 @@ CFileItem::CFileItem(const std::shared_ptr<CPVRRecording>& record)
// Set art
if (!record->m_strIconPath.empty())
- {
SetArt("icon", record->m_strIconPath);
+ else
+ {
+ const std::shared_ptr<CPVRChannel> channel = record->Channel();
+ if (channel && !channel->IconPath().empty())
+ SetArt("icon", channel->IconPath());
+ else if (record->IsRadio())
+ SetArt("icon", "DefaultAudio.png");
+ else
+ SetArt("icon", "DefaultTVShows.png");
}
if (!record->m_strThumbnailPath.empty())
@@ -254,6 +269,10 @@ CFileItem::CFileItem(const std::shared_ptr<CPVRTimerInfoTag>& timer)
if (!timer->ChannelIcon().empty())
SetArt("icon", timer->ChannelIcon());
+ else if (timer->m_bIsRadio)
+ SetArt("icon", "DefaultAudio.png");
+ else
+ SetArt("icon", "DefaultTVShows.png");
FillInMimeType(false);
}