From 10b19606e0e12b267fb1182453e2079bdf5d0154 Mon Sep 17 00:00:00 2001 From: Timmy Welch Date: Sun, 5 Nov 2023 21:36:29 -0800 Subject: [PATCH] Fix GenericMetadata __str__ --- comicapi/genericmetadata.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/comicapi/genericmetadata.py b/comicapi/genericmetadata.py index 4169a7a..5833d4a 100644 --- a/comicapi/genericmetadata.py +++ b/comicapi/genericmetadata.py @@ -23,6 +23,7 @@ from __future__ import annotations import copy import dataclasses import logging +from collections.abc import Sequence from typing import Any, TypedDict from typing_extensions import NamedTuple @@ -315,7 +316,10 @@ class GenericMetadata: return "No metadata" def add_string(tag: str, val: Any) -> None: - if val is not None and str(val) != "": + if isinstance(val, Sequence): + if val: + vals.append((tag, val)) + elif val is not None: vals.append((tag, val)) def add_attr_string(tag: str) -> None: