Added featured videos model, paginator and cache

This commit is contained in:
Digital Artifex
2026-06-17 16:07:11 -04:00
parent be089a43f7
commit 26fb04431e
8 changed files with 2657 additions and 345 deletions
+16 -26
View File
@@ -65,14 +65,12 @@ public:
UuidRole = Qt::UserRole + 1,
AuthorRole,
AuthorIdRole,
DescriptionRole,
NameRole,
AuthorUrlRole,
DurationRole,
ThumbnailRole,
CreatedDateRole,
PriceRole,
CurrencyRole,
DownloadCountRole,
TypeRole
UrlRole,
HeightRole,
WidthRole
};
Q_ENUM(DataRole)
@@ -251,36 +249,28 @@ private:
QByteArray("authorId")
},
{
static_cast<int>(DescriptionRole),
QByteArray("description")
static_cast<int>(AuthorUrlRole),
QByteArray("authorUrl")
},
{
static_cast<int>(NameRole),
QByteArray("name")
static_cast<int>(DurationRole),
QByteArray("duration")
},
{
static_cast<int>(ThumbnailRole),
QByteArray("thumbnail")
},
{
static_cast<int>(CreatedDateRole),
QByteArray("createdDate")
static_cast<int>(UrlRole),
QByteArray("url")
},
{
static_cast<int>(PriceRole),
QByteArray("price")
static_cast<int>(HeightRole),
QByteArray("height")
},
{
static_cast<int>(CurrencyRole),
QByteArray("currency")
},
{
static_cast<int>(DownloadCountRole),
QByteArray("downloadCount")
},
{
static_cast<int>(TypeRole),
QByteArray("type")
static_cast<int>(WidthRole),
QByteArray("width")
}
};
State m_state = Idle;
@@ -289,7 +279,7 @@ private:
FeaturedVideosPaginator *m_paginator = nullptr;
mutable QList<WallpaperCache> m_data;
mutable QList<VideoCache> m_data;
Q_PROPERTY(State state READ state WRITE setState RESET resetState NOTIFY stateChanged FINAL)
Q_PROPERTY(QString errorString READ errorString WRITE setErrorString NOTIFY errorStringChanged FINAL)