Google Drive: search folder via ID

Hello,


I have a problem. I have an Google Drive account with more then 4GB data files. 
The problem is that the main function GetDriveInfo() needs more than one minute to get the complete file/folder list.

My only intention is to load files from a specific folder. The problem is my program creates the speciifc folder the first time and saves the ID string of the folder in an ini file. So far I've been through the treeview list to get the TCloudItem from the specific folder.

It is better the program should only load the file list from folder with the folder ID as string.
Do you think you can implement this function like this?

function TAdvCustomGDrive.SearchListByID(FolderID: String): TCloudItems;
var
  QueryParam: string;
begin
  Drive.Clear;

    if FolderID <> '' then
      QueryParam := 'q=' + URLEncode('''' + FolderID + ''' in parents')
    else
      raise Exception.Create('Missing Folder ID');

  Result := GetFileListInt(QueryParam);
end;

Hi,


Have you tried using the GetFolderList(Folder: TCloudItem) method?
For the Folder parameter, you should be able to provide a manually created TGDriveItem object with only the ID property assigned.

Hi,


no I didn't, because the unique ID of the folder is a string value like: 0B6CghM849zNjlpO
And TCloudItem.ID is an integer value.

Sorry, my fault. if I use a TGDriveItem object the ID property is string. 

I will try it...

Okay, it works. Great :-)


But could you tell me which function calls will replace the data in the Drive collection? It seems GetFolderList() will not create the Drive collection again.
If not, how is it possible to manipulate/create the Drive collection?

In this case you can use the TCloudItems result from the GetFolderList call instead of the Drive collection.

HI!

How do I find a file from the already saved ID?

Hi,


Can you please try using the GetFileInfo(FileID: string) method?

Hi,
I have a litte problem with AdvGDrive.SearchFile function.
If I search a file with a %27 char in the title, the function return api exeption.
In the cloudbase file the urlencode function don't encode this char.

Any solution please?

 

Hi,


Thank you for notifying. This issue has now been fixed.
The update will be available with the next release of the TMS FMX Cloud Pack.

Hi Bart, I'm on my first post in this forum and I have commited  a error not posting in the correct section. I did not see that it was refered to the FMX Cloud Pack. I have VCL Cloud Pack and I solved temporarily the problem modifying the encodeurl function by inserting the escape character "" before the apostrophe. To be premised that I completely disregard the delphi, so I do not know if I have done everything correctly. An update of the VCL Cloud Pack would be welcome. Thank's

No problem. The same fix will be applied to the next update of the TMS VCL Cloud Pack as well.