1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 02:32:33 +01:00

[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.
This commit is contained in:
Mike Fährmann 2019-11-30 17:27:49 +01:00
parent a412531451
commit 26d2334550
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
2 changed files with 6 additions and 5 deletions

View File

@ -1465,8 +1465,8 @@ Description Select how to write metadata.
* ``"json"``: all metadata using `json.dump()
<https://docs.python.org/3/library/json.html#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"``

View File

@ -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