Pomax / node-flickrapi

A node.js (and client-library) implementation of the Flickr API with oauth API key authentication and API method proxying
177 stars 52 forks source link

fixed uncaught exception when tag or title #80

Closed callmewa closed 8 years ago

callmewa commented 8 years ago

fixed uncaught exception when tag or title (both optional according to api) is not provided for upload.

updated test accordingly

callmewa commented 8 years ago

ran into this problem during development.. hopefully others can benefit from this change

Pomax commented 8 years ago

While I can understand uploading an image without tags, uploading an image without a title makes no sense, so it's pretty important that a missing title causes an error somewhere, even if this is not the right place for it. There should always be an options.title, so if this patch gets to land, it needs to at the very least also contain a fix somewhere so that the default title for an upload, if there is no explicit title, is the photo's filename.

callmewa commented 8 years ago

Here is flickr's rest api options for uploading a photo. We should not place additional restrictions on the flexibility the API offers us. https://www.flickr.com/services/api/upload.api.html Depending on what you are trying to do with your application it makes perfect sense not to have a title for the photo.
title (optional) The title of the photo. description (optional) A description of the photo. May contain some limited HTML. tags (optional) A space-seperated list of tags to apply to the photo.

Pomax commented 8 years ago

fair enough - please add your testcase as new case though, don't rewrite the ones that were already there.

callmewa commented 8 years ago

Just wondering if the last commit was acceptable. Thanks

Pomax commented 8 years ago

yeah, github just decided to not notify me that a new commit had been pushed. Looks good to me.