Lightroom SDK: Event Notification

  • 5
  • Idea
  • Updated 7 years ago
Problem: It is difficult to keep custom metadata ala plugins up to date.

Present workarounds I know of:
- Have a background thread constantly poll for changes to dependencies.
- User must manually initiate updates.

The former solution takes far more prowess (and time/effort) on the part of the plugin author, and tends to be slow, and sometimes problematic.

The latter is just klunky for the user, and a primary reason people dont adopt plugins to support custom metadata.

I'd like to suggest an extension to the SDK/API so plugins can register to be notified of changes to dependencies, for example:

catalog:registerForEvent( pluginID, eventID, delegateCallbackFunction, ... )

That way, plugins could be notified immediately of dependency changes, and update custom metadata immediately.

Say bye-bye to all the update functions in the plugin-extras menu.

Rob
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 376 Reply Likes

Posted 7 years ago

  • 5
Photo of John R. Ellis

John R. Ellis, Champion

  • 3457 Posts
  • 877 Reply Likes
Wouldn't a lot of the need for this go away if plugins could access the metadata as fast as LR can internally? Some of the APIs for accesssing metadata are more than 10x slower on Windows than on Mac. This forces plugins to cache metadata in files or custom metadata fields.
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 376 Reply Likes
I agree that if polling is lightning fast, then event notification is just a convenience, not a necessity.

But, I'm guessing we won't see dramatic speed increases come Lr4. Hope I'm wrong.

Not sure how you polled for new keywords in AnyTag, but I'm guessing you went through the entire set, one-by-one, looking for new ones, no? Wouldn't a new keyword event been a big help? Or are you suggesting that you would not have needed your local bookeeping at all if Lr's books were lightning fast?

Rob
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 376 Reply Likes
"Some of the APIs for accesssing metadata are more than 10x slower on Windows than on Mac." - ripe for a feature request here, no?
Photo of John R. Ellis

John R. Ellis, Champion

  • 3457 Posts
  • 877 Reply Likes
AnyTag does indeed enumerate the keyword tree, starting at the root, repeating every couple of minutes in background.

If keywords could be accessed through the API as fast as LR accesses them internally (or as fast as LR can export them to a file), there wouldn't be any need for polling. AnyTag would just access them each time the plugin was invoked.

I think it's highly likely that LR has an internal in-memory data structure of keywords behind the keywords pane. Providing SDK access to that in-memory structure should be at least two orders of magnitude faster than the 30 - 60 keywords/sec we currently see on Windows.

A keyword-changed event would be better than nothing, for sure. But it would have to handle deletions, renames, and re-parenting in the hierarchy, as well as allowing the plugin to recognize when it has been disabled for a while and needs to "catch up" (presumably by reloading all the keywords).