mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Implement #6523 (New value for existing tweak)
This commit is contained in:
parent
b0a6721540
commit
3b52187aee
@ -24,6 +24,7 @@ series_index_auto_increment = 'next'
|
|||||||
# invert: use "fn ln" -> "ln, fn" (the original algorithm)
|
# invert: use "fn ln" -> "ln, fn" (the original algorithm)
|
||||||
# copy : copy author to author_sort without modification
|
# copy : copy author to author_sort without modification
|
||||||
# comma : use 'copy' if there is a ',' in the name, otherwise use 'invert'
|
# comma : use 'copy' if there is a ',' in the name, otherwise use 'invert'
|
||||||
|
# nocomma : "fn ln" -> "ln fn" (without the comma)
|
||||||
author_sort_copy_method = 'invert'
|
author_sort_copy_method = 'invert'
|
||||||
|
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ def author_to_author_sort(author):
|
|||||||
author = _bracket_pat.sub('', author).strip()
|
author = _bracket_pat.sub('', author).strip()
|
||||||
tokens = author.split()
|
tokens = author.split()
|
||||||
tokens = tokens[-1:] + tokens[:-1]
|
tokens = tokens[-1:] + tokens[:-1]
|
||||||
if len(tokens) > 1:
|
if len(tokens) > 1 and method != 'nocomma':
|
||||||
tokens[0] += ','
|
tokens[0] += ','
|
||||||
return ' '.join(tokens)
|
return ' '.join(tokens)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user