flingo64 / PhotoStation-Upload-Lr-Plugin

Photo StatLr (aka PhotoStation Upload) is a Lightroom Publish and Export Service Plugin that enables the export /publishing of photos and videos from Lr to a Synology Photo Station. It uploads the photos/videos and all required thumbnails. It can download comments and ratings and do a real two-way synch of various metadata (tags, ratings, labels).
http://messmer-online.de/index.php/software/11-photo-statlr
GNU General Public License v3.0
209 stars 21 forks source link

Renaming anomaly during publishing #49

Closed mpeter1975 closed 3 years ago

mpeter1975 commented 3 years ago

Hi!

I want to publish some of my select images into a new structure. Some images are master photos, some are virtual copies.

Master photo filenames: YYYYMMDD_HHMMSS_NNNN (where NNNN is a sequence number with trailing zeros if needed) Virtual copies have their Copy Name metadata set to NNNN of the master photo

In publishing the rename string is: {LrCC:name}-{LrFM:copyName}

The output for master photos are OK, but for the virtual copies are not. They look like: collectionname-copyname-copyname. So the Copy Name is repeated.

If i use the {LrCC:name} only, the output is collectionname-copyname

I don't understand.

flingo64 commented 3 years ago

{LrFM:copyName} expands to the CopyName metadata of a photo, as you said. This string is always appended as suffix to the resulting filename, so that a 'normal' Publish/Export w/o renaming option will work also if photos and virtual copies are to be exported to the same folder. This feature is was mentioned in the Changelog for version 5.9 (quite hard to find, I agree), but can be seen in the logfile, when you use loglevel Trace at leasr So, in your case {LrFM:copyName} doesn't make to much sense, you can just remove the {LrFM:copyName} placeholder. Instead, I would expect to see {LrFM:fileName} in your renaming definition. Regarding the use of {LrCC:name}: you might want to add an extract pattern, because if a photo is in more than one Collection, the result of {LrCC:name} is undeterministic: the name of the first found collection will be used.

mpeter1975 commented 3 years ago

Thanks for the info. I admit, I did not read changelogs, I just used the documentation to figure out what I need.

What I wanted to accomplish was to publish these images with this filename logic: text - collection name - NNNN (where NNNN is the same sequence number as used in the original filename for reference)

I haven't found a way to define the extract pattern. The only one possibility is to get the name of the Collection which the child of X > Y > Z collections sets (letters represent a level in the set tree), which i cannot do. I also had problem with the renaming if I have master photos and virtual copies. Thus I decided to put only new virtual copies in these collections, so the 1:1 relation between photo and collection is secured. Please let me know if there is other solution 👍

Thanks for the help.

flingo64 commented 3 years ago

To extract the 4 digit suffix of the pathname, you could use '{LrFM:fileName .+(%d%d%d%d)%.%w+$}', check the Lua pattern link in the doc to get familiar with Lua pattern. Did you check the {LrCC:path} token to specify a collection within a specific collection hierarchy?

mpeter1975 commented 3 years ago

Thanks for the hint! Although i have experience with regexp I have failed with lua pattern. I checked the {LrCC:path} but also could not extract the name of the last collection.

Nevermind, I'll check again, you have helped a lot.

What could not be done in Lr, is to create a smart filter and gather all photos from collections in a specific collection set into one Published Collection.