gphotos-uploader-cli
gphotos-uploader-cli copied to clipboard
Add the possibility to customise Album names
Is your feature request related to a problem? Please describe.
Currently there are two ways to create Album names: folderPath
and folderName
. These options doesn't cover too much use cases. As it was raised at #150 .
Describe the solution you'd like I'd like be able to customise the Album name based on the data I've got and using several functions.
Describe alternatives you've considered The alternative is that the user modifies the folders locally before uploading files.
Additional context Something similar to Mp3Tag scripting.
First iteration could be using MakeAlbums.use
configuration option with:
Fields
Placeholder | Description |
---|---|
%_directory% | Name of the parent directory (same as folderName ) |
%_parent_directory% | Name of the grandparent folder |
%_folderpath% | Path without file name (same as folderPath ) |
%_date% | Short date |
%_datetime% | Long date |
Functions
Placeholder | Description |
---|---|
$cutLeft(x,n) | Removes the first n characters of string x and returns the result. |
$cutRight(x,n) | Removes the last n characters of string x and returns the result. |
$regexp(x,expr,repl) | Replaces the pattern specified by the regular expression expr in the string x by repl. The fourth optional parameter enables ignore case (1) or disables the ignore case setting (0). Please note that you have to escape comma and other special characters in expr. |
$caps(x) | Converts the given string to normal case. |
$upper(x) | Converts the given string to upper case. |
$lower(x) | Converts the given string to lower case. |
Examples
Case conversion Normal
Command: $caps(string)
Example: $caps(This is my %_directory% )
This example converts the given string to normal case.
/foo/bar/file.jpg
converts to This is my Bar
Case conversion UPPER
Command: $upper(string)
Example: $upper(My album is %_parent_directory%)
This example converts the given string to upper case.
/foo/bar/file.jpg
converts to MY ALBUM IS FOO
Case conversion lower
Command: $lower(string)
Example: $lower(My album is %_folderpath%)
This example converts the given string to lower case.
/foo/bar/file.jpg
converts to my album is /foo/bar
Replace some characters
Command: $regexp(x,expr,repl)
Example: $regexp(%folderpath%,/,)
This example replaces /
in the given string for _
/foo/bar/file.jpg
converts to _foo_bar
Maybe also the possibility to call an external shell script / command and use the content of stdout?
Maybe this mechanism could also be used to manipulate the info text?
Pull request summited: https://github.com/gphotosuploader/gphotos-uploader-cli/pull/431