diff options
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, |
