From a9cdd7d9a1b00465984fad833b0371750a785e08 Mon Sep 17 00:00:00 2001 From: DraftKinner <196864209+DraftKinner@users.noreply.github.com> Date: Sat, 22 Mar 2025 13:08:42 -0400 Subject: [PATCH] Fixed issue #21 --- zotify/playable.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/zotify/playable.py b/zotify/playable.py index d1dfc80..b85f1e3 100644 --- a/zotify/playable.py +++ b/zotify/playable.py @@ -82,10 +82,17 @@ class Playable: if not isinstance(library, Path): library = Path(library) for meta in self.metadata: - if meta.string is not None: + if meta.string is not None and len(meta.string) < 100: output = output.replace( "{" + meta.name + "}", fix_filename(meta.string) ) + else: + if "," in meta.string: + shortened = ",".join(meta.string.split(",", 3)[:3]) + else: + shortened = f"{meta.string[:50]}..." + output = output.replace("{" + meta.name + "}", fix_filename(shortened)) + if meta.name == "spotid": spotid = meta.string