mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Commits from @MartB and more ...
- Commit: 1d9165f403
- New default QT capture implementation
- UploadHandler added to Effects Configurator to allow uploading GIF files
- Docker compile script and instruction
- Travis Fix
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include <QFileInfo>
|
||||
#include <QDir>
|
||||
#include <QMap>
|
||||
#include <QByteArray>
|
||||
|
||||
// createEffect helper
|
||||
struct find_schema: std::unary_function<EffectSchema, bool>
|
||||
@@ -69,7 +70,15 @@ const bool EffectFileHandler::deleteEffect(const QString& effectName, QString& r
|
||||
{
|
||||
if (effectConfigurationFile.exists())
|
||||
{
|
||||
if ( (it->script == ":/effects/gif.py") && !it->args.value("image").toString("").isEmpty())
|
||||
{
|
||||
QFileInfo effectImageFile(effectConfigurationFile.absolutePath() + "/" + it->args.value("image").toString());
|
||||
if (effectImageFile.exists())
|
||||
QFile::remove(effectImageFile.absoluteFilePath());
|
||||
}
|
||||
|
||||
bool result = QFile::remove(effectConfigurationFile.absoluteFilePath());
|
||||
|
||||
if (result)
|
||||
{
|
||||
updateEffects();
|
||||
@@ -141,6 +150,17 @@ const bool EffectFileHandler::saveEffect(const QJsonObject& message, QString& re
|
||||
newFileName.setFile(f);
|
||||
}
|
||||
|
||||
//TODO check if filename exist
|
||||
if (!message["imageData"].toString("").isEmpty() && !message["args"].toObject().value("image").toString("").isEmpty())
|
||||
{
|
||||
QFileInfo imageFileName(effectArray[0].toString().replace("$ROOT",_rootPath) + "/" + message["args"].toObject().value("image").toString());
|
||||
if(!FileUtils::writeFile(imageFileName.absoluteFilePath(), QByteArray::fromBase64(message["imageData"].toString("").toUtf8()), _log))
|
||||
{
|
||||
resultMsg = "Error while saving image file '" + message["args"].toObject().value("image").toString() + ", please check the Hyperion Log";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(!JsonUtils::write(newFileName.absoluteFilePath(), effectJson, _log))
|
||||
{
|
||||
resultMsg = "Error while saving effect, please check the Hyperion Log";
|
||||
|
Reference in New Issue
Block a user