Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add function for getting thumbnail batches. #164

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

rain2o
Copy link

@rain2o rain2o commented Apr 1, 2020

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.

@mvalasis
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants