From c7ca9d055c7178367def28cccd0d814c8444d7e9 Mon Sep 17 00:00:00 2001 From: Rhet Turnbull Date: Wed, 16 Nov 2022 20:30:47 -0800 Subject: [PATCH] Fix for kMDItemKeywords as comma delimited string, #83 --- osxmetadata/mditem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osxmetadata/mditem.py b/osxmetadata/mditem.py index b5049af..f9edb33 100644 --- a/osxmetadata/mditem.py +++ b/osxmetadata/mditem.py @@ -152,7 +152,7 @@ def get_mditem_metadata( # some attributes like kMDItemKeywords do not always follow the documented type # and can return a single comma-delimited string instead of a list (See #83) return ( - str(value).split(",") + [x.strip() for x in str(value).split(",")] if isinstance(value, (objc.pyobjc_unicode, str)) else [str(x) for x in value] )