• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to find out what LR publish service publishes: collection or collection set?

Community Beginner ,
Apr 05, 2019 Apr 05, 2019

Copy link to clipboard

Copied

Hi.

could you please help me to solve such a problem

I have publish service with structured collection set:

Screenshot_1.jpeg.jpg

My goal is to publish all collection set even if user selects child collection (like it shows on the screenshot). Second variant is to show notification for user that he should select 'Collection set' before pressing publish (if he selected it Lightroom will publish all collections as i want). I'm working on second variant and cant figure out how to check if we publishing one collection instead of collection set.

TOPICS
SDK

Views

517

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Apr 05, 2019 Apr 05, 2019

The LrExportContext object passed by LR to your processRenderedPhotos() contains the field "publishedCollectionInfo", which provides information about the LrPublishedCollection being published.  I'm not sure what it contains when the user has selected a collection set and click Published.  But you could set a breakpoint in the debugger and see what it contains in that instance.

If the information in "publishedCollectionInfo" does allow you to distinguish between when the user has selected a colle

...

Votes

Translate

Translate
LEGEND ,
Apr 05, 2019 Apr 05, 2019

Copy link to clipboard

Copied

The LrExportContext object passed by LR to your processRenderedPhotos() contains the field "publishedCollectionInfo", which provides information about the LrPublishedCollection being published.  I'm not sure what it contains when the user has selected a collection set and click Published.  But you could set a breakpoint in the debugger and see what it contains in that instance.

If the information in "publishedCollectionInfo" does allow you to distinguish between when the user has selected a collection versus a collection set, the service's processRenderedPhotos() function can check that, open a message dialog, and then raise an error to terminate the publishing operation.

If "publishedCollectionInfo" doesn't allow you to distinguish when the user has selected a collection, another approach would be to require the user to publish using a Library menu command, e.g. Library > Plug-in Extras > My Publish.  This command call catalog:getActiveSources() to determine whether a collection or collection set has been selected, raising an error if a collection is selected.  It would then set a global flag and call collection:publishNow() for each collection contained in the selected collection set.  The service's processRenderedPhotos() function would check for the global flag -- if it's false, that means the user has clicked on Pubish directly, and you can raise an error.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 08, 2019 Apr 08, 2019

Copy link to clipboard

Copied

LATEST

Thank you!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines