Skip navigation
Currently Being Moderated

Access to plugin metadata from publish deletion callback

Mar 12, 2011 6:30 AM

I'm using publishServiceProvider.deletePhotosFromPublishedCollection() to hook into publish deletions and ran into a bit of a snag.  I'm also using photo:setPropertyForPlugin() to set plugin and LrPhoto specific metadata that I'd like to nil out on deletion, but I can't seem to grok getting the LrPhoto ref while in the deletion callback.


Basically, given a set of plugin properties and a simple array of photoIds, I can't figure out how to clean up my metadata for a specific LrPhoto item.


Any suggestions?

  • Currently Being Moderated
    Mar 12, 2011 8:46 PM   in reply to clvrmnky

    Interesting -- publishServiceProvider.deletePhotosFromPublishedCollection()  doesn't provide the LrPublishedCollection from which the photos are being deleted.  Seems like a design oversight.

    Here's brute-force solution for creating a table on the fly that maps remote ids to LrPhotos for your publish service:


    - Get the plugin's LrPublishService via



    - Enumerate all LrPublishedCollections and LrPublishedCollectionSets in the service via publishService:getChildCollections() and :getChildCollectionSets().


    - Enumerate all the LrPublishedPhotos in the published collections via publishedCollection:getPublishedPhotos().


    - For each LrPublishedPhoto, call publishedPhoto:getPhoto() and :getRemoteId() to get the LrPhoto and remote id, which you can add to the table.



    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points