From 26d2334550c56271aa40404a9a2773d9e795364e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sat, 30 Nov 2019 17:27:49 +0100 Subject: [PATCH] [postprocessor:metadata] rename 'format' to 'content-format' Just to be consistent with the other 'extension-format' option name, and only 'format' is also still accepted. --- docs/configuration.rst | 8 ++++---- gallery_dl/postprocessor/metadata.py | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/configuration.rst b/docs/configuration.rst index d03dd2d5..3d0ba4a3 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -1465,8 +1465,8 @@ Description Select how to write metadata. * ``"json"``: all metadata using `json.dump() `_ * ``"tags"``: ``tags`` separated by newlines - * ``"custom"``: result of applying `metadata.format`_ to a file's - metadata dictionary + * ``"custom"``: result of applying `metadata.content-format`_ + to a file's metadata dictionary =========== ===== metadata.extension @@ -1490,8 +1490,8 @@ Description Custom format string to build filename extensions for metadata Note: `metadata.extension`_ is ignored if this option is set. =========== ===== -metadata.format ---------------- +metadata.content-format +----------------------- =========== ===== Type ``string`` Example ``"tags:\n\n{tags:J\n}\n"`` diff --git a/gallery_dl/postprocessor/metadata.py b/gallery_dl/postprocessor/metadata.py index 20f47a15..75c5fffa 100644 --- a/gallery_dl/postprocessor/metadata.py +++ b/gallery_dl/postprocessor/metadata.py @@ -20,7 +20,8 @@ class MetadataPP(PostProcessor): mode = options.get("mode", "json") if mode == "custom": self.write = self._write_custom - self.contentfmt = util.Formatter(options.get("format")).format_map + cfmt = options.get("content-format") or options.get("format") + self.contentfmt = util.Formatter(cfmt).format_map ext = "txt" elif mode == "tags": self.write = self._write_tags