mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 08:56:25 +02:00
Add activity logging for uploading_asset
This commit is contained in:
parent
014a7bc9b0
commit
88810d28c1
1 changed files with 19 additions and 0 deletions
|
@ -105,6 +105,25 @@ void AssetMappingsScriptingInterface::uploadFile(QString path, QString mapping,
|
||||||
|
|
||||||
startedCallback.call();
|
startedCallback.call();
|
||||||
|
|
||||||
|
QFile file { path };
|
||||||
|
int64_t size { 0 };
|
||||||
|
if (file.open(QIODevice::ReadOnly)) {
|
||||||
|
size = file.size();
|
||||||
|
file.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString extension = "";
|
||||||
|
auto idx = path.lastIndexOf(".");
|
||||||
|
if (idx) {
|
||||||
|
extension = path.mid(idx + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
UserActivityLogger::getInstance().logAction("uploading_asset", {
|
||||||
|
{ "size", size },
|
||||||
|
{ "mapping", mapping },
|
||||||
|
{ "extension", extension}
|
||||||
|
});
|
||||||
|
|
||||||
auto upload = DependencyManager::get<AssetClient>()->createUpload(path);
|
auto upload = DependencyManager::get<AssetClient>()->createUpload(path);
|
||||||
QObject::connect(upload, &AssetUpload::finished, this, [=](AssetUpload* upload, const QString& hash) mutable {
|
QObject::connect(upload, &AssetUpload::finished, this, [=](AssetUpload* upload, const QString& hash) mutable {
|
||||||
if (upload->getError() != AssetUpload::NoError) {
|
if (upload->getError() != AssetUpload::NoError) {
|
||||||
|
|
Loading…
Reference in a new issue