Merge branch 'feat/avatarTools/avatarPackager' of github.com:thoys/hifi into feat/avatarTools/avatarPackager

This commit is contained in:
Thijs Wenker 2019-01-05 00:01:25 +01:00
commit b0db81b861

View file

@ -190,7 +190,12 @@ void MarketplaceItemUploader::doUploadAvatar() {
QString jsonString = "{\"marketplace_item\":{"; QString jsonString = "{\"marketplace_item\":{";
jsonString += "\"title\":\"" + escapeJson(_title) + "\""; jsonString += "\"title\":\"" + escapeJson(_title) + "\"";
jsonString += ",\"description\":\"" + escapeJson(_description) + "\"";
// Items cannot have their description updated after they have been submitted.
if (creating) {
jsonString += ",\"description\":\"" + escapeJson(_description) + "\"";
}
jsonString += ",\"root_file_key\":\"" + escapeJson(_rootFilename) + "\""; jsonString += ",\"root_file_key\":\"" + escapeJson(_rootFilename) + "\"";
jsonString += ",\"category_ids\":[" + QStringLiteral("%1").arg(_categoryID) + "]"; jsonString += ",\"category_ids\":[" + QStringLiteral("%1").arg(_categoryID) + "]";
jsonString += ",\"license\":0"; jsonString += ",\"license\":0";
@ -300,12 +305,13 @@ void MarketplaceItemUploader::doWaitForInventory() {
success = isAssetAvailable(); success = isAssetAvailable();
} }
if (success) { if (success) {
qDebug() << "Found item in inventory";
setState(State::Complete); setState(State::Complete);
} else { } else {
constexpr int MAX_INVENTORY_REQUESTS { 8 }; constexpr int MAX_INVENTORY_REQUESTS { 8 };
constexpr int TIME_BETWEEN_INVENTORY_REQUESTS_MS { 5000 }; constexpr int TIME_BETWEEN_INVENTORY_REQUESTS_MS { 5000 };
qDebug() << "Failed to find item in inventory";
if (_numRequestsForInventory > MAX_INVENTORY_REQUESTS) { if (_numRequestsForInventory > MAX_INVENTORY_REQUESTS) {
qDebug() << "Failed to find item in inventory";
setError(Error::Unknown); setError(Error::Unknown);
} else { } else {
QTimer::singleShot(TIME_BETWEEN_INVENTORY_REQUESTS_MS, [this]() { doWaitForInventory(); }); QTimer::singleShot(TIME_BETWEEN_INVENTORY_REQUESTS_MS, [this]() { doWaitForInventory(); });