Repository navigation
#1584: file-name tokens for every stored metadata field - #1694
Merged
Merged
Conversation
The file-name templates shared by Export, Rename Photos and import renaming
knew {title} and {creator} only; a marker kept in another metadata field (a
collection number in Headline, a SKU in Alt Text, issue #1584) could not reach
the exported file's name. rename::TOKENS now covers every text and capture
field the catalog stores: {caption}, {headline}, {category}, {keywords}
(spaces), {copyright}, {job_title}, {location}, {city}, {state}, {country},
{serial}, {alt_text}, {extended_description}, {description_writer},
{shutter}, {aperture} (bare number: f/ would become - in a name) and {focal}
(24mm). Slideshow text overlays keep their own {caption}/{copyright}/
{shutter}/{aperture}/{focal} forms; their extra callback still answers first.
A field the photo doesn't have leaves an empty gap, as before.
The Tags picker, the photo.renameTokens help, the three command descriptions
and the MCP schema list the new tokens; each meaning is translated in every
fork catalog (294 strings).
Test: rename::tests::metadata_tokens_name_files_from_the_stored_fields expands
each new token, the technical forms and the empty-gap rule;
token_help_matches_the_implementation pins that the help, the sample photo and
the command descriptions agree with expand_tokens.
Manual: output/export-location (token list).
Co-Authored-By: ZCode
Owner
Author
|
PR steward (automated): reviewed and merging. Fast gate is green, all 17 new tokens have strings in every fork locale, and the manual, whats-new and changelog are updated. One small nit for later: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Issue #1584 asks for more metadata fields as tags in the Export file-name section (the reporter marks photos with a collection number in IPTC Job Identifier and a SKU in a spare field, and needs those markers in the exported file names for recipients who don't use a photo library).
The template system's
rename::TOKENSlist now covers every text and capture field the catalog already stores, beside the existing{title}/{creator}:{caption}{headline}{category}{keywords}{copyright}{job_title}{location}{city}{state}{country}{serial}{alt_text}{extended_description}{description_writer}{shutter}{aperture}{focal}One template language, everywhere it is shared: Export File name, Rename Photos, import renaming, import folder templates, Edit In. The Tags picker,
photo.renameTokens, thephoto.rename/photo.renamePreview/library.importcommand descriptions and the MCP schema all list the new tokens; each meaning is translated in all 17 fork catalogs (294 strings).Choices worth noting:
{keywords}joins with spaces;{aperture}is the bare number (8,2.8) —f/8would lose its/in a name (f-8);{focal}is24mm. Slideshow text overlays keep their own{caption}/{shutter}/{aperture}/{focal}forms — theirextracallback still answers first there.Iptc4xmpExtjob id would be a separate metadata feature, and with{headline}/{category}/{alt_text}/{extended_description}/{description_writer}there are now five free marker fields to choose from.Test
rename::tests::metadata_tokens_name_files_from_the_stored_fields: every new token expands from its field, technical forms (aperture number-only, focal24mm), keywords join, empty-gap rule, and a fullSKU-{keywords}name.token_help_matches_the_implementation(existing) pins that every listed tag expands, the sample photo gives every tag a non-empty example, and the three command descriptions mention every token.cargo xtask ci --quick: fmt, brand, docs, notes, i18n, windows, clippy, heif all green. The one failure islcc-catalog tests_backup_prune::two_libraries_sharing_a_backup_folder…— the pre-existing red onorigin/stagingthat intake PR Upstream intake 2026-11-29: 25 PRs #1681 fixes (fails on cleanorigin/stagingwithout this diff; the ui-egui i18n gaps are the same story, 3 faces strings × 17 languages, also Upstream intake 2026-11-29: 25 PRs #1681).cargo xtask paritypasses.Manual: output/export-location — token list extended.
Closes #1584