Skip to content

Commit

Permalink
feat(author-update): ✨ set author sort name
Browse files Browse the repository at this point in the history
  • Loading branch information
djdembeck committed Oct 3, 2021
1 parent 8dfa708 commit e6e616b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Contents/Code/__init__.py
Expand Up @@ -259,6 +259,16 @@ def compile_metadata(self, helper):
# Title.
if not helper.metadata.title or helper.force:
helper.metadata.title = helper.name
# Sort Title.
if not helper.metadata.title_sort or helper.force:
split_author_surname = re.match(
'^(.+?).([^\s,]+)(,?.(?:[JS]r\.?|III?|IV))?$',
helper.name,
)
helper.metadata.title_sort = (
split_author_surname.group(2) + ', ' +
split_author_surname.group(1)
)
# Thumb.
if helper.thumb not in helper.metadata.posters or helper.force:
helper.metadata.posters[helper.thumb] = Proxy.Media(
Expand Down

0 comments on commit e6e616b

Please sign in to comment.