RISCfuture / dropbox

An easy-to-use client library for the official Dropbox API.
MIT License
519 stars 47 forks source link

Directory modified hashes not supported #24

Closed coreyward closed 13 years ago

coreyward commented 13 years ago

Per the Dropbox API:

Use the hash parameter to metadata with the last hash you had so that you can get a shorter list. What this does is give you a 304 if hash matches, and the contents again if the hash is different from what we have.

Unfortunately, it doesn't appear that this gem supports that functionality. It looks like support was started, but the relevant line that hands the :hash option on in Dropbox::API#metadata is commented out:

#args.last[:hash] = options[:hash] if options[:hash]

I'm curious why this is the case. I don't want to have to loop through all of the files in the directory to determine which have changed when the hash is different if I can avoid doing so. I suspect it has something to do with handling that 304 status or avoiding unexpected behavior in regards to deleted files (which apparently don't affect the hash returned in metadata calls to the Dropbox API).

RISCfuture commented 13 years ago

Done -- 7c16bc4ddd4f6cc1185d426fb7e70648d4fb739e (push forthcoming)