mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 12:04:18 +02:00
Fixes
This commit is contained in:
parent
e70f6855aa
commit
df2153186d
2 changed files with 15 additions and 8 deletions
|
@ -18,6 +18,10 @@
|
|||
#include <recording/Frame.h>
|
||||
#include <recording/ClipCache.h>
|
||||
|
||||
|
||||
#include <QtScript/QScriptValue>
|
||||
#include <AssetClient.h>
|
||||
#include <AssetUpload.h>
|
||||
#include <QtCore/QUrl>
|
||||
#include <QtWidgets/QFileDialog>
|
||||
|
||||
|
@ -176,13 +180,18 @@ void RecordingScriptingInterface::saveRecording(const QString& filename) {
|
|||
}
|
||||
|
||||
bool RecordingScriptingInterface::saveRecordingToAsset(QScriptValue getClipAtpUrl) {
|
||||
if (!getClipAtpUrl.isFunction())
|
||||
if (!getClipAtpUrl.isFunction()) {
|
||||
qCWarning(scriptengine) << "The argument is not a function.";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (QThread::currentThread() != thread()) {
|
||||
bool result{ false };
|
||||
QMetaObject::invokeMethod(this, "saveRecordingToAsset", Qt::BlockingQueuedConnection,
|
||||
Q_ARG(QScriptValue, getClipAtpUrl));
|
||||
return false;
|
||||
Q_ARG(QScriptValue, getClipAtpUrl),
|
||||
Q_RETURN_ARG(bool, result));
|
||||
return result;
|
||||
}
|
||||
|
||||
if (!_lastClip) {
|
||||
|
@ -192,7 +201,6 @@ bool RecordingScriptingInterface::saveRecordingToAsset(QScriptValue getClipAtpUr
|
|||
|
||||
if (auto upload = DependencyManager::get<AssetClient>()->createUpload(recording::Clip::toBuffer(_lastClip), HFR_EXTENSION)) {
|
||||
QObject::connect(upload, &AssetUpload::finished, this, [=](AssetUpload* upload, const QString& hash) mutable {
|
||||
auto filename = QFileInfo(upload->getFilename()).fileName();
|
||||
QString clip_atp_url = "";
|
||||
|
||||
if (upload->getError() == AssetUpload::NoError) {
|
||||
|
@ -200,7 +208,7 @@ bool RecordingScriptingInterface::saveRecordingToAsset(QScriptValue getClipAtpUr
|
|||
clip_atp_url = QString("%1:%2.%3").arg(URL_SCHEME_ATP, hash, upload->getExtension());
|
||||
upload->deleteLater();
|
||||
} else {
|
||||
qDebug() << "Error during the Asset upload.";
|
||||
qCWarning(scriptengine) << "Error during the Asset upload.";
|
||||
}
|
||||
|
||||
QScriptValueList args;
|
||||
|
@ -211,6 +219,7 @@ bool RecordingScriptingInterface::saveRecordingToAsset(QScriptValue getClipAtpUr
|
|||
return true;
|
||||
}
|
||||
|
||||
qCWarning(scriptengine) << "Saving on asset failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,9 +18,7 @@
|
|||
#include <recording/Forward.h>
|
||||
#include <recording/Frame.h>
|
||||
|
||||
#include <QtScript/QScriptValue>
|
||||
#include <AssetClient.h>
|
||||
#include <AssetUpload.h>
|
||||
class QScriptValue;
|
||||
|
||||
class RecordingScriptingInterface : public QObject, public Dependency {
|
||||
Q_OBJECT
|
||||
|
|
Loading…
Reference in a new issue