1 Reply Latest reply on Nov 14, 2014 3:14 AM by Waters99

    Remote Collection Id for deletePhotosFromPublishedCollection

    Waters99

      Wondering if it's possible to retrieve the remote collection Id, during the call to deletePhotosFromPublishedCollection.

       

      At the moment the localCollectionId is handed to the method, which is a little unusual, as in most other API calls, there's an info object, that gives us access to the collection, and the remote collection id - for example with info.publishedCollection:getRemoteId()

       

      function publishServiceProvider.deletePhotosFromPublishedCollection( publishSettings, arrayOfPhotoIds, deletedCallback, localCollectionId )

       

         for i, photoId in ipairs( arrayOfPhotoIds ) do

         deletePhoto( publishSettings, { lr_id = localCollectionId, image_id = photoId, suppressErrorCodes = { [ 1 ] = true } } )


         deletedCallback( photoId )

       

         end
        
      end

       

      Thoughts?

        • 1. Re: Remote Collection Id for deletePhotosFromPublishedCollection
          Waters99 Level 1

          solved...

           

          function publishServiceProvider.deletePhotosFromPublishedCollection( publishSettings, arrayOfPhotoIds, deletedCallback, localCollectionId )

           

             local catalog = LrApplication.activeCatalog()

             local publishedCollection = catalog:getPublishedCollectionByLocalIdentifier(localCollectionId)

             local remoteId = publishedCollection:getRemoteId()

           

             for i, photoId in ipairs( arrayOfPhotoIds ) do

             deletePhoto( publishSettings, { storyId = remoteId, imageId = photoId, suppressErrorCodes = { [ 1 ] = true } } )


             deletedCallback( photoId )

           

             end
            
          end