Lightroom SDK: collection set shows photos, but child collections do not

  • 1
  • Problem
  • Updated 7 years ago
This happens when add-photos collection method is called after remove-all-photos in the same with-write-access-do call, for example - the Changed Photos collection has 3 photos, but none are shown unless I select the parent collection set:


If I select RC xEmP (Dev) collection set then all photos are displayed.
(there is only the one collection in the collection set)

If remove-all-photos and add-photos are wrapped separately ( separate with-write-access-do calls ), then this problem does not happen.

This works:

local s, m = cat:withRetries( 20, catalog.withWriteAccessDo, "Remove photos from collection", function( context )
coll:removeAllPhotos()
end )
if s then
local s, m = cat:withRetries( 20, catalog.withWriteAccessDo, "Add photos to collection", function( context )
coll:addPhotos( call.collPhotos )
end )


This results in the aforementioned problem:

local s, m = cat:withRetries( 20, catalog.withWriteAccessDo, "Remove photos from collection", function( context )
coll:removeAllPhotos()
coll:addPhotos( call.collPhotos )
end )
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 384 Reply Likes

Posted 7 years ago

  • 1

Be the first to post a reply!