Having run across this problem while helping with the LR2Zenphoto plugin, it appears there is a need for an additional field in the image tables. It would help if there was a field (external_id?) that could be set for maintaining a unique id from an external program (such as LR). Right now, the plugin uses name and date/time for identifying the image. This fails when there are virtual copies (which share all of the creation info). However, every entry in the database has a unique image id, so being able to store that would solve the issue of attempting to find matching images when more than one copy exist.
Comments
In Zenphoto the id is NOT the unique identifer actually, Zenphoot internally for its object model uses the filename and the album name (more exact the album folder tree if in an subalbum) to identify an item.
If you refer to Lightroom the current developer jphilbert of it would be a good address to discuss the plugin's needs. http://philbertphotos.github.io/Zenphoto-Lightroom-Publisher/
If you need extra database fields you should try to use the `plugin_storage` table for that. Use Zenphoto's id to link that to the `images` table.
PS: It would really help readability if you would use some paragraphs sometimes..:-)
The plugin_storage isn't really that useful for this need; it would require the plugin to maintain a separate data structure (and all of the managing routines). This seems like a really high overhead for something that could prove beneficial to many other plugins, or could if they knew one was there. ;}
As a programmer, it also feels to me like something that got left out, because nobody thought integrating with external programs was important. That may not be the reason, but when you have the abilities to install plugins that potentially automate from other sources, then some additions for ease of integration should be considered. A way to uniquely identify an image is such a one...
Anyway, it would be a simple and useful expansion to the whole idea of automating other sources, and does help immensely with the problem of cross-indexing images between zenphoto and external applications. Thus the request...
Cheers!
The plugin_storage table actually was exactly made for custom needs on the table (a concept from WP btw). Several plugins use them already (RSS hitcounter, downloadlist). For that table there are even no object methods since you can use it in too many possible ways.
Anyway, feel free to open a ticket on the Github issue tracker. The "chief" will decide about it then.
I'm looking over the requirements for using the plugin storage; but it looks like then he'd need to do an sql query (since the index can not be the same as the zenphoto id if more than one plugin is using it, so simple way is out)? Or am I just remembering it wrong?
Didn't you tell him not to do sql queries directly? :}
I'll probably add it to the bug tracker, and see what dust I can shake off.. :}
Cheers!
To the plugin storage and your question with several plugins I did answer on your ticket how to do it.
Yes, generally you should not use mysl for Zenphoto items. Plugin storage has no fixed usage as with these on that table. You can use the fields it provides creatively for anything you desire and make up so it is up to you. Thus there are no object methods for it. Which does not mean that your plugin could not have some for it if needed or even extending the image class via the plugin (like the video/textobject classes do).
I will also use it to store things like ablum password since "getpass" give me back a hash and can be bit useless on the lightroom end
SO it will be plugin_storage-Album ID and an array or JSON of custom data for that album ...albumpassowrd, virtual copy ID etc...
https://github.com/zenphoto/zenphoto/issues/389