25 m_list(std::move(list)),
51 LOG(VB_GENERAL, LOG_ERR,
"Cannot load screen 'MythArtworkResults'");
55 for (
const auto &
info : std::as_const(
m_list))
58 button->SetText(
info.label,
"label");
59 button->SetText(
info.thumbnail,
"thumbnail");
60 button->SetText(
info.url,
"url");
61 QString width = QString::number(
info.width);
62 QString height = QString::number(
info.height);
63 button->SetText(width,
"width");
64 button->SetText(height,
"height");
65 if (
info.width > 0 &&
info.height > 0)
66 button->SetText(QString(
"%1x%2").arg(width, height),
69 QString artfile =
info.thumbnail;
71 if (artfile.isEmpty())
77 if (!artfile.isEmpty())
82 button->SetImage(dlfile);
87 QVariant::fromValue<uint>(pos));
91 button->SetData(QVariant::fromValue<ArtworkInfo>(
info));
104 QString cache = QString(
"%1/cache/metadata-thumbcache")
106 QDir cacheDir(cache);
107 QStringList thumbs = cacheDir.entryList(QDir::Files);
109 for (
const auto & thumb : std::ranges::reverse_view(std::as_const(thumbs)))
111 QString
filename = QString(
"%1/%2").arg(cache, thumb);
113 QDateTime lastmod = fi.lastModified();
116 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Deleting file %1")
static void cleanCacheDir()
MythUIButtonList * m_resultsList
void haveResult(ArtworkInfo, VideoArtworkType)
MetadataImageDownload * m_imageDownload
ImageSearchResultsDialog(MythScreenStack *lparent, ArtworkList list, VideoArtworkType type)
void sendResult(MythUIButtonListItem *item)
void customEvent(QEvent *event) override
~ImageSearchResultsDialog() override
Screen in which all other widgets are contained and rendered.
void BuildFocusList(void)
static const Type kEventType
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)