diff --git a/gallery_dl/postprocessor/metadata.py b/gallery_dl/postprocessor/metadata.py index 93dd9a19..18d00e13 100644 --- a/gallery_dl/postprocessor/metadata.py +++ b/gallery_dl/postprocessor/metadata.py @@ -189,7 +189,7 @@ class MetadataPP(PostProcessor): tags = [] extend = tags.extend 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() fp.write("\n".join(tags) + "\n") diff --git a/test/test_postprocessor.py b/test/test_postprocessor.py index b64df882..fb1d739e 100644 --- a/test/test_postprocessor.py +++ b/test/test_postprocessor.py @@ -365,8 +365,8 @@ class MetadataTest(BasePostprocessorTest): self._create( {"mode": "tags"}, {"tags": [ - {"g": "foobar1", "m": "foobar2"}, - {"g": None, "m": "foobarbaz"} + {"g": "foobar1", "m": "foobar2", "u": True}, + {"g": None, "m": "foobarbaz", "u": [3, 4]}, ]}, ) with patch("builtins.open", mock_open()) as m: