[pp:metadata] ignore non-string tag values (#4764)
This commit is contained in:
@@ -189,7 +189,7 @@ class MetadataPP(PostProcessor):
|
|||||||
tags = []
|
tags = []
|
||||||
extend = tags.extend
|
extend = tags.extend
|
||||||
for tagdict in taglists:
|
for tagdict in taglists:
|
||||||
extend([x for x in tagdict.values() if x is not None])
|
extend([x for x in tagdict.values() if isinstance(x, str)])
|
||||||
tags.sort()
|
tags.sort()
|
||||||
|
|
||||||
fp.write("\n".join(tags) + "\n")
|
fp.write("\n".join(tags) + "\n")
|
||||||
|
|||||||
@@ -365,8 +365,8 @@ class MetadataTest(BasePostprocessorTest):
|
|||||||
self._create(
|
self._create(
|
||||||
{"mode": "tags"},
|
{"mode": "tags"},
|
||||||
{"tags": [
|
{"tags": [
|
||||||
{"g": "foobar1", "m": "foobar2"},
|
{"g": "foobar1", "m": "foobar2", "u": True},
|
||||||
{"g": None, "m": "foobarbaz"}
|
{"g": None, "m": "foobarbaz", "u": [3, 4]},
|
||||||
]},
|
]},
|
||||||
)
|
)
|
||||||
with patch("builtins.open", mock_open()) as m:
|
with patch("builtins.open", mock_open()) as m:
|
||||||
|
|||||||
Reference in New Issue
Block a user