diff options
| author | 2022-08-29 02:17:16 -0400 | |
|---|---|---|
| committer | 2022-08-29 02:17:16 -0400 | |
| commit | a768930761f7f20587ae40a8cacca0e55c85290a (patch) | |
| tree | 5a4163db912b93fc45f717e5e43fd5be3e66f16c /gallery_dl/formatter.py | |
| parent | ae2a0f5622beaa6f402526f8a7b939419283a090 (diff) | |
New upstream version 1.23.0.upstream/1.23.0
Diffstat (limited to 'gallery_dl/formatter.py')
| -rw-r--r-- | gallery_dl/formatter.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gallery_dl/formatter.py b/gallery_dl/formatter.py index bc4d837..dd32b8a 100644 --- a/gallery_dl/formatter.py +++ b/gallery_dl/formatter.py @@ -296,12 +296,14 @@ def _parse_maxlen(format_spec, default): def _parse_join(format_spec, default): separator, _, format_spec = format_spec.partition(_SEPARATOR) - separator = separator[1:] + join = separator[1:].join fmt = _build_format_func(format_spec, default) - def join(obj): - return fmt(separator.join(obj)) - return join + def apply_join(obj): + if isinstance(obj, str): + return fmt(obj) + return fmt(join(obj)) + return apply_join def _parse_replace(format_spec, default): @@ -379,6 +381,7 @@ _CONVERSIONS = { "T": util.datetime_to_timestamp_string, "d": text.parse_timestamp, "U": text.unescape, + "g": text.slugify, "S": util.to_string, "s": str, "r": repr, |
