From 3b52187aeedc91659f61b3b118a3db7de4a4a83b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 16 Aug 2010 09:50:25 -0600 Subject: [PATCH] Implement #6523 (New value for existing tweak) --- resources/default_tweaks.py | 1 + src/calibre/ebooks/metadata/__init__.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/default_tweaks.py b/resources/default_tweaks.py index 80456234b9..d6f134f724 100644 --- a/resources/default_tweaks.py +++ b/resources/default_tweaks.py @@ -24,6 +24,7 @@ series_index_auto_increment = 'next' # invert: use "fn ln" -> "ln, fn" (the original algorithm) # copy : copy author to author_sort without modification # 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' diff --git a/src/calibre/ebooks/metadata/__init__.py b/src/calibre/ebooks/metadata/__init__.py index 1e62cffd0f..8ce81c73d5 100644 --- a/src/calibre/ebooks/metadata/__init__.py +++ b/src/calibre/ebooks/metadata/__init__.py @@ -38,7 +38,7 @@ def author_to_author_sort(author): author = _bracket_pat.sub('', author).strip() tokens = author.split() tokens = tokens[-1:] + tokens[:-1] - if len(tokens) > 1: + if len(tokens) > 1 and method != 'nocomma': tokens[0] += ',' return ' '.join(tokens)