Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

BLOBs: Multiple feature requests
#1

Hi team

first of all thank you for the fixes just pushed - list files works perfectly.

The intention with the lowcode script I was trying to use this in was to
1. browse a folder containing mp4 videos
2. upload them to the cloud for use in an app.
 
The first request is an issue I've had with LiveCloud as well: uploading a blob does not retain the filename or modifiable metadata for the file and essentially just contains a UUID and an extension. Therefore working with BLOBs is not possible unless I also create a kind of join table to include the BLOB UUID and metadata, whereas this could be solved easily by including the filename as a key in the cdbBlobs table. This is fine and it works but is extra work.

In Appli, this script uploads the BLOBs and populates a separate table with their IDs and filenames. This works but may not be the most efficient:
   

So the first question is: can I use blobType in livecloud with the filename instead of the extension to make up for this? (I attempted to create. new key in the cdbBlobs table but that caused catastrophic errors only solved when I deleted the project...).
The second question is: was there an easier way to achieve the tasks shown in the script above?

If not, then the first feature request is: would it be possible to consider adding a "description" key in cdbBlobs that could for example be populated with the filename by default?



Another issue I've had with BLOBs is that create blob has been implemented as a non-blocking action - but there is as far as I can see no way to set up a callback/notification for when upload has been completed. Since there is no batch upload in Appli (as far as I can see), that means this is a stepwise process and there is no way for the app to know when the process has been completed.

So my second feature request is: please consider implementing callbacks for BLOB actions in Appli and BLOB handlers in LiveCloud 
As far as I can see there is no easy way to periodically poll this from Appli so I dont' think I can work around this; and in LiveCode + LiveCloud it would mean setting up a recurring handler to check if the number of records in LiveCloud matches the number of records the handler knows it has uploaded - again a lot of extra and possibly error-prone work.

If adding a callback isn't feasible, is it possible to have an option to make this a blocking action, so the script cannot proceed until upload is complete?

Many thanks once again,
Stam
Reply
#2

Hi Stam,

The "blobType" key in the "cdbBlobs" table cannot be edited to store a filename. Additional information for each blob can be stored in user-created keys in the "cdbBlobs" table. To do this, you can open the Data Modeler in Appli by clicking the icon in the footer (or using the shortcut CMD + D/CTRL + D), click the vertical ellipses icon of the "cdbBlobs" table, and select "add key". When the blob is created, the record can be updated with its filename into the newly added key.

This process requires some manual steps to include the filename in the blob record however. I'll be adding your feature request for a new default key that automatically stores filenames to our list.

You're correct that there's no batch create blob in Appli at this time. We continue to add new actions including ones adapted from LiveCloud's API. I'll add a "batch create blob" action to our list.

In Appli, the "get result" action from the "database" category can be used to check whether actions that call CanelaDB are successful or not. This can be done in LiveCloud and is the equivalent of the "cdb_result" API. True will be returned if the call was successful and false if it was not.
Reply
#3

(Yesterday, 01:26 AM)linda Wrote:  Additional information for each blob can be stored in user-created keys in the "cdbBlobs" table.

Thanks Linda,

I was a bit concerned about doing this because when I attempted this exact thing in LiveCloud recently, the LiveCloudManager became unresponsive and it was impossible to add or remove tables to the project. I could only "fix" this by deleting the entire project. I tried this 3 times with failures every time, requiring me to delete the entire project to be able to use LiveCloud again.

My assumption was (perhaps incorrectly from what you’re saying) that it wasn't possible to add keys to the cdbBlobs table.
So you see my concern... I work around it by creating a kind of join table that contains the cdbRecordID for the blob and the filename that was used to create said blob.

However if you say this is valid and will not cause issues, I'll explore it again with Appli in the first instance, before re-trying LiveCloud (although not sure why that would be different...).

(Yesterday, 01:26 AM)linda Wrote:  In Appli, the "get result" action from the "database" category can be used to check whether actions that call CanelaDB are successful or not. This can be done in LiveCloud and is the equivalent of the "cdb_result" API. True will be returned if the call was successful and false if it was not.

Yes - I do use this a lot in LiveCloud/LiveCode.
But with batch uploading blobs, it takes ages for liveCloud to actually show that something has been uploaded (in my example, uploading 98 short videos it showed 6, then after a while 24 then after about 5-10 minutes the 98 videos had been uploaded.

Given that I want to associate each upload with the filename of the blob passed to the createBlob handler (again, not sure why this isn't just a key in LiveCloud since the information is already passed to the function...), and given that uploads appear deferred to the future, if I attempt to add a value to a record that doesn't yet exist won't that cause a problem?

In liveCloud I poll the result with a recursive “send In time” handler to ensure that the record count in LiveCloud is equal to the number of elements of the array that contains the data to upload and only create a join table as above once the batch upload has finished. But again I ran into errors and found the only reproducible way was to upload 1 blob at a time and then create 1 joint table row at a time which is a bit slower.

Or maybe I’m making errors somewhere - I’ll have to double check. In the mean time the script I posted works…

Many thanks for taking time to look into this,
Stam
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)