Have the authorization part finished yet and works ok (no errors etc). After this I want to get the folders and files from the root of the drive. Starting first to get the files in the root (the procedure is rather similar to get the folders using children instead).
I have designed the following code (according to the google example that produces a similar result), this is a part of my drive class:
o.cdGetCloudFiles = function(fCallback, sFolderId )
{
var oDefQ = {q:'trashed=false', maxResults:1000, folderId:(typeof sFolderId == 'string')?sFolderId:'root'},
fGetFiles = function(request, result)
{
request.execute(function(resp)
{
if( resp.items instanceof Array )
{
result = result.concat(resp.items);
if( resp.nextPageToken )
{ // Get next file and 'break' this function
return fGetFiles(gapi.client.drive.files.list($j.extend(oDefQ,{'pageToken':resp.nextPageToken})), result);
}
}
fCallback(result.length?result:false);
});
};
fGetFiles(gapi.client.drive.files.list(oDefQ), []);
};
The original code can be found here: https://developers.google.com/drive/v2/reference/files/list
There are two files and one directory in the root of the drive:
[folder] Alice Deejay - Who Needs Guitars Anyway
[file] A day without rain.mp3
[file] Discobitch - C'est beau la bourgeoisie.mp3
The problem is that I don't get any files using the example above. When I change 'trashed=false'
into 'trashed=true'
then I get four deleted files (I previously delete from the drive).
Can somebody explain why I don't see/get any files? Also changed the rights to public but doesn't seems to make any difference.