Skip to content

Commit

Permalink
fix(author-update): 🐛 single name authors would have sort applied err…
Browse files Browse the repository at this point in the history
…oneously
  • Loading branch information
djdembeck committed Oct 9, 2021
1 parent c974f5c commit 80e2554
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Contents/Code/__init__.py
Expand Up @@ -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,
Expand Down

0 comments on commit 80e2554

Please sign in to comment.