mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 11:07:50 +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();
|
||||
|
||||
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);
|
||||
QObject::connect(upload, &AssetUpload::finished, this, [=](AssetUpload* upload, const QString& hash) mutable {
|
||||
if (upload->getError() != AssetUpload::NoError) {
|
||||
|
|
Loading…
Reference in a new issue