cloudinary icon indicating copy to clipboard operation
cloudinary copied to clipboard

more methods

Open frankapimenta opened this issue 9 years ago • 9 comments

is it possible to have the remove_tag methods and so?

frankapimenta avatar May 20 '16 17:05 frankapimenta

That would be good. I need to give this package some love, I'll see what I can do over the week ^_^

Lepozepo avatar May 23 '16 14:05 Lepozepo

What's more, looks like the official Cloudinary library has evolved a lot (v2): https://github.com/cloudinary/cloudinary_js/releases

Lepozepo many thanks for your work :)

nicooprat avatar May 26 '16 12:05 nicooprat

Are there new functions published?

Thank you for your work :)

frankapimenta avatar Jun 15 '16 12:06 frankapimenta

@frankapimenta I haven't added new helpers, I did upgrade dependencies though. I need to watch those packages to keep up with them. I'm going to try to give S3 some love too then I'll come back to this one to add some more helpers.

Lepozepo avatar Jun 16 '16 02:06 Lepozepo

@Lepozepo I would require to have the remove tag helper. If you tell me where to start with it would make things easier to me and I would do the pull request. I'm short in time ( like everybody else I guess :D )

frankapimenta avatar Jun 16 '16 09:06 frankapimenta

@frankapimenta Sounds like that would go somewhere around here: https://github.com/Lepozepo/cloudinary/blob/master/client/functions.coffee#L41 but build it however you want. If it works and doesn't break things I'll accept. I don't care much for code style so long as results are met. I'll move things around after ^_^

Lepozepo avatar Jun 16 '16 14:06 Lepozepo

Would this (from http://cloudinary.com/documentation/image_upload_api_reference#api_example_12) as meteor call:


"c.remove_tag": (tag, publicIds) ->
    @unblock()
    check tag, String
    check publicIds, Array

    if Cloudinary.rules.delete
      @public_id = public_id
      auth_function = _.bind Cloudinary.rules.delete,this
      if not auth_function()
        throw new Meteor.Error "Unauthorized", "Delete not allowed"

    future = new Future()

    Cloudinary.uploader.remove_tag tag, publicIds, (result) ->
      future.return result

    return future.wait()

and this as client side function:


remove_tag: (tag, publicIds, callback) ->

  Meteor.call "c.remove_tag", tag, publicIds, (error,result) ->
    if error
        return callback and callback error, null
    else
        if result.deleted[public_id] and result.deleted[public_id] is "not_found"
          return callback and callback result, null
        else
          return callback and callback null,result

be ok to you?

frankapimenta avatar Jun 18 '16 09:06 frankapimenta

Hmm, looking at the way all the other functions work maybe we can iterate over each and wrapAsync instead. Then we wouldn't need to do much extra work if they update their API.

Lepozepo avatar Jun 26 '16 00:06 Lepozepo

any news regarding this? :)

frankapimenta avatar Jul 07 '16 19:07 frankapimenta