I have an issue with Google drive API
I have a requirement to do pagination with results to show only files with page limit of 50. I did this using following query.
"Id in parents and mimeType != 'application/vnd.google-apps.folder' and trashed = false"
But in output I see page limit varying all the time. Some times showing 47,46,..so on. Rarely 50.
I think this issue is because of filtering folders after get 50 files and returning response from API to my application.
Is there any other way to get pagination correctly and retrieve only files from API calls
Thanks for reply. Actually I have a requirement to do pagination with files limit(Only files) of 50 per page in order to resolve session time out issue often faced with Google Drive.
Consider Following Scenario: I have 200 files in my folder among which [98 files+102 folders] with page limit of 100.
1st request to API: Internally fetches 100[files+folders] and returns 98 files and page token to my application.
Issue : According to my requirement I should show 100 files per page but now I am showing only 98 saying we have more files available because I got next page token. If i try to check if more files available before enabling view more option this causes more API calls till it finds files or till page token is null which may increase probability of session timeout.
2nd request to API: Because view more is enabled when user clicks it we don't fetch anything because remaining are folders.
Is there any other way to fulfill my requirement to reduce session timeout issue.