Fixed bug for multi-field templates and --xattr-template, #422

This commit is contained in:
Rhet Turnbull
2021-04-17 02:41:29 -07:00
parent 874ad2fa34
commit 6a288676a1
3 changed files with 76 additions and 14 deletions

View File

@@ -1,3 +1,3 @@
""" version info """
__version__ = "0.42.1"
__version__ = "0.42.2"

View File

@@ -3307,7 +3307,7 @@ def write_finder_tags(
# filter out any template values that didn't match by looking for sentinel
rendered_tags = [
tag for tag in rendered_tags if _OSXPHOTOS_NONE_SENTINEL not in tag
value.replace(_OSXPHOTOS_NONE_SENTINEL, "") for value in rendered_tags
]
tags.extend(rendered_tags)
@@ -3358,10 +3358,10 @@ def write_extended_attributes(photo, files, xattr_template, strip=False):
),
err=True,
)
# filter out any template values that didn't match by looking for sentinel
rendered = [
value for value in rendered if _OSXPHOTOS_NONE_SENTINEL not in value
]
rendered = [value.replace(_OSXPHOTOS_NONE_SENTINEL, "") for value in rendered]
try:
attributes[xattr].extend(rendered)
except KeyError: