dropbox-php-sdk
dropbox-php-sdk copied to clipboard
Add function for getting thumbnail batches.
Closes #152
Added the ability to retrieve thumbnails in batches. In order to accomplish this I had to add the ability to have different Endpoint Types and Endpoint Formats. As per the Dropbox documentation the thumbnail batch endpoint uses the Content endpoint, but it requires the RPC format (which is typically used by the regular API). Including the Dropbox-API-Arg header throws an error for this endpoint. So I added an additional optional argument for endpointFormat. By default it matches the endpointType, but added a function to make a call to the Content API with the RPC format.
I did it this way in an attempt to reduce the amount of impactful changes where possible. Instead of changing postToContent which would require modifying a lot of calls to that function, I created a new function to use this difference - postToContentAsRpc.
Let me know if you'd like it done in a different way. This is a feature I require in my current project to be able to use this package. I'm having to use a patch until this gets implemented.
Hey, thanks for the pull request! It really helped me!
When a .zip file is in the list of files, I get the following:
PHP Warning: Undefined array key "metadata" in /Dropbox/Models/ThumbnailList.php on line 30 PHP Warning: Undefined array key "thumbnail" in /Dropbox/Models/ThumbnailList.php on line 30 PHP Fatal error: Uncaught TypeError: Kunnu\Dropbox\Models\File::__construct(): Argument #1 ($data) must be of type array, null given, called in /Dropbox/Models/ThumbnailList.php on line 30 and defined in /Dropbox/Models/File.php:30