[Windows] Fix driver version detection of AMD RDNA+ GPU on Windows 10
[xbmc.git] / xbmc / pvr / PVRChannelGroupImageFileLoader.cpp
blobb66ef0090259f6f1382f891a3a3800ca5a3f6ee6
1 /*
2 * Copyright (C) 2023 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #include "PVRChannelGroupImageFileLoader.h"
11 #include "FileItem.h"
12 #include "FileItemList.h"
13 #include "filesystem/PVRGUIDirectory.h"
14 #include "guilib/Texture.h"
15 #include "pictures/Picture.h"
16 #include "pvr/PVRCachedImages.h"
17 #include "utils/log.h"
19 bool PVR::CPVRChannelGroupImageFileLoader::CanLoad(const std::string& specialType) const
21 return specialType == "pvr";
24 std::unique_ptr<CTexture> PVR::CPVRChannelGroupImageFileLoader::Load(const std::string& specialType,
25 const std::string& filePath,
26 unsigned int,
27 unsigned int) const
29 const CPVRGUIDirectory channelGroupDir(filePath);
30 CFileItemList channels;
31 if (!channelGroupDir.GetChannelsDirectory(channels))
33 return {};
36 std::vector<std::string> channelIcons;
37 for (const auto& channel : channels)
39 const std::string& icon = channel->GetArt("icon");
40 if (!icon.empty())
41 channelIcons.emplace_back(CPVRCachedImages::UnwrapImageURL(icon));
43 if (channelIcons.size() == 9) // limit number of tiles
44 break;
47 return CPicture::CreateTiledThumb(channelIcons);