From 80e25540da47846fd3ffc5fbed13e49480ece1ac Mon Sep 17 00:00:00 2001 From: djdembeck Date: Sat, 9 Oct 2021 18:16:13 -0500 Subject: [PATCH] fix(author-update): :bug: single name authors would have sort applied erroneously --- Contents/Code/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Contents/Code/__init__.py b/Contents/Code/__init__.py index d7c10be..d756e97 100644 --- a/Contents/Code/__init__.py +++ b/Contents/Code/__init__.py @@ -256,7 +256,10 @@ def compile_metadata(self, helper): helper.metadata.title = helper.name # Sort Title. if not helper.metadata.title_sort or helper.force: - if Prefs['sort_author_by_last_name']: + if Prefs['sort_author_by_last_name'] and not ( + # Handle single word names + re.match(r'\A[\w-]+\Z', helper.name) + ): split_author_surname = re.match( '^(.+?).([^\s,]+)(,?.(?:[JS]r\.?|III?|IV))?$', helper.name,