added %C as shorthand for common '%(..)c%(..)f'...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2025-06-18 16:31:03 +03:00
parent a832589dcf
commit 28f455a732

View File

@ -1749,12 +1749,14 @@ var FileSystemWriterActions = actions.Actions({
// history / presets... // history / presets...
'export-paths': [], 'export-paths': [],
'export-preview-name-patterns': [ 'export-preview-name-patterns': [
'%(fav)l%n%(-bookmarked)b%(-%c)c', // XXX should we auto-append %C to everything???
'%(fav)l%n%(-bookmarked)b%(-m)m%(-%c)c', '%(fav)l%n%(-bookmarked)b%C',
'%(fav)l%n%(-%c)c', '%(fav)l%n%(-bookmarked)b%(-m)m%C',
'%(fav)l%i-%n', '%(fav)l%n%C',
'%(fav)l%g-%n', '%(fav)l%i-%n%C',
'%(fav)l%g-%n%C',
], ],
'export-%C-value': '%(-%c)c%(.%f)f',
// XXX add options to indicate: // XXX add options to indicate:
// - long side // - long side
// - short side // - short side
@ -1804,6 +1806,7 @@ var FileSystemWriterActions = actions.Actions({
//*/ //*/
}, },
// XXX %c should also be able to handle output collisions, i.e. when // XXX %c should also be able to handle output collisions, i.e. when
// a file already exists... // a file already exists...
// ...or should this be a different placeholder handled // ...or should this be a different placeholder handled
@ -1837,6 +1840,8 @@ var FileSystemWriterActions = actions.Actions({
%(...)m - add text in braces if image marked %(...)m - add text in braces if image marked
%(...)b - add text in braces if image is bookmark %(...)b - add text in braces if image is bookmark
%C - shorthand for '%(-%c)c%(.%f)f'.
(set in .config['export-%C-value'])
%(...)c - add text in braces if there are name conflicts %(...)c - add text in braces if there are name conflicts
present in current index, but only if the current present in current index, but only if the current
image has a conflicting name. image has a conflicting name.
@ -1950,6 +1955,7 @@ var FileSystemWriterActions = actions.Actions({
.replace(/%T/, total_len) .replace(/%T/, total_len)
// conflict count... // conflict count...
.replace(/%C/, this.config['export-%C-value'] ?? '%(-%c)c%(.%f)f')
.replace(/%c/, (conflicts && conflicts[gid]) ? .replace(/%c/, (conflicts && conflicts[gid]) ?
conflicts[gid].indexOf(gid) conflicts[gid].indexOf(gid)
: 0) : 0)
@ -2543,6 +2549,7 @@ var FileSystemWriterActions = actions.Actions({
// XXX get/form image name... // XXX get/form image name...
// XXX might be a good idea to connect this to the info framework... // XXX might be a good idea to connect this to the info framework...
// XXX generate next name if write failed...
var name = that.formatImageName(pattern, var name = that.formatImageName(pattern,
gid, gid,
{ {
@ -2886,10 +2893,14 @@ var FileSystemWriterUIActions = actions.Actions({
actions.formatImageName(pattern, actions.formatImageName(pattern,
img, img,
{tags: ['bookmark']})], {tags: ['bookmark']})],
['Repeating:', ['Repeating in index:',
actions.formatImageName(pattern, actions.formatImageName(pattern,
img, img,
{conflicts: {[actions.current]: ['', actions.current], }} )], {conflicts: {[actions.current]: ['', actions.current], }} )],
['Repeating in filesystem:',
actions.formatImageName(pattern,
img,
{number: 1})],
['All:', ['All:',
actions.formatImageName(pattern, actions.formatImageName(pattern,
img, img,
@ -2900,7 +2911,8 @@ var FileSystemWriterUIActions = actions.Actions({
], ],
conflicts: { conflicts: {
[img]: ['', img], [img]: ['', img],
} },
number: 1,
} )], } )],
], { ], {
cls: 'table-view', cls: 'table-view',