Bugfixes for hub backends

This commit is contained in:
Digital Artifex
2025-09-23 06:24:57 -04:00
parent 557e518c79
commit 3c40711014
3 changed files with 13 additions and 7 deletions

View File

@@ -14,6 +14,10 @@ add_library(
AudioModel.cpp AudioModel.cpp
AudioImageProvider.cpp AudioImageProvider.cpp
ShaderPackMetadata.cpp ShaderPackMetadata.cpp
ShaderPackModel.h
AudioModel.h
AudioImageProvider.h
ShaderPackMetadata.h
GeometryProvider.cpp GeometryProvider.cpp
GeometryProvider.h GeometryProvider.h
PexelsImageMetadata.h PexelsImageMetadata.h

View File

@@ -459,6 +459,8 @@ void ShaderToySearchModel::save(quint64 index)
const QStringList keys = externalMedia.keys(); const QStringList keys = externalMedia.keys();
qWarning() << QStringLiteral("Downloading %1 Images").arg(externalMedia.count());
setStatus(Compiling, QStringLiteral("Downloading images")); setStatus(Compiling, QStringLiteral("Downloading images"));
setTotalDownloads(externalMedia.count()); setTotalDownloads(externalMedia.count());
@@ -475,7 +477,7 @@ void ShaderToySearchModel::install(quint64 index)
setCompletedDownloads(0); setCompletedDownloads(0);
setTotalDownloads(0); setTotalDownloads(0);
QString tempLocation = QStringLiteral("%1/komplex/src/%2").arg(QStandardPaths::writableLocation(QStandardPaths::TempLocation), entry.metadata.id); QString tempLocation = QStringLiteral("%1/komplex/build/%2").arg(QStandardPaths::writableLocation(QStandardPaths::TempLocation), entry.metadata.id);
QString installLocation = QStringLiteral("%1/.local/share/komplex/packs/%2").arg(QStandardPaths::writableLocation(QStandardPaths::HomeLocation), entry.metadata.id); QString installLocation = QStringLiteral("%1/.local/share/komplex/packs/%2").arg(QStandardPaths::writableLocation(QStandardPaths::HomeLocation), entry.metadata.id);
QDir installDirectory(installLocation); QDir installDirectory(installLocation);
@@ -605,11 +607,11 @@ void ShaderToySearchModel::download(quint64 index)
tags, tags,
static_cast<bool>(infoObject[QStringLiteral("usePreview")].toInt()), static_cast<bool>(infoObject[QStringLiteral("usePreview")].toInt()),
infoObject[QStringLiteral("username")].toString(), infoObject[QStringLiteral("username")].toString(),
rootObject[QStringLiteral("version")].toString(), rootObject[QStringLiteral("ver")].toString(),
static_cast<quint64>(infoObject[QStringLiteral("views")].toInt()) static_cast<quint64>(infoObject[QStringLiteral("views")].toInt())
}; };
QJsonArray ShaderToyRenderPassArray = rootObject[QStringLiteral("ShaderToyRenderPass")].toArray(); QJsonArray ShaderToyRenderPassArray = rootObject[QStringLiteral("renderpass")].toArray();
for(const QJsonValue &ShaderToyRenderPassValue : std::as_const(ShaderToyRenderPassArray)) for(const QJsonValue &ShaderToyRenderPassValue : std::as_const(ShaderToyRenderPassArray))
{ {
@@ -667,7 +669,7 @@ void ShaderToySearchModel::download(quint64 index)
entry.status = ShaderToyEntry::Idle; entry.status = ShaderToyEntry::Idle;
m_data[index] = entry; m_data.replace(index, entry);
QModelIndex modelIndex = this->index(index, 0); QModelIndex modelIndex = this->index(index, 0);
Q_EMIT dataChanged(modelIndex, modelIndex); Q_EMIT dataChanged(modelIndex, modelIndex);
} }

View File

@@ -44,9 +44,9 @@ public:
qmlRegisterSingletonType<AudioModel*>(uri, 1, 0, "AudioModel", komplexAudioSingletonProvider); qmlRegisterSingletonType<AudioModel*>(uri, 1, 0, "AudioModel", komplexAudioSingletonProvider);
qmlRegisterType<ShaderPackModel>(uri, 1, 0, "ShaderPackModel"); qmlRegisterType<ShaderPackModel>(uri, 1, 0, "ShaderPackModel");
qmlRegisterType<GeometryProvider>(uri, 1, 0, "GeometryProvider"); qmlRegisterType<GeometryProvider>(uri, 1, 0, "GeometryProvider");
qmlRegisterType<ShaderToySearchModel>(stUri, 1, 0, "SearchModel"); qmlRegisterType<ShaderToySearchModel>(uri, 1, 0, "ShaderToySearchModel");
qmlRegisterType<PexelsVideoSearchModel>(pvUri, 1, 0, "SearchModel"); qmlRegisterType<PexelsVideoSearchModel>(uri, 1, 0, "PexelsVideoSearchModel");
qmlRegisterType<PexelsImageSearchModel>(piUri, 1, 0, "SearchModel"); qmlRegisterType<PexelsImageSearchModel>(uri, 1, 0, "PexelsImageSearchModel");
} }
void unregisterTypes() override void unregisterTypes() override