From 89d2b56ce89d9a916eb5f6c105bd7fb87f5fabf6 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 18 Apr 2011 08:39:42 -0600 Subject: [PATCH] Fix #764472 (Set author from author sort button ignores tweak) --- src/calibre/gui2/metadata/basic_widgets.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/metadata/basic_widgets.py b/src/calibre/gui2/metadata/basic_widgets.py index 9502fcb205..f918009a56 100644 --- a/src/calibre/gui2/metadata/basic_widgets.py +++ b/src/calibre/gui2/metadata/basic_widgets.py @@ -278,11 +278,13 @@ class AuthorSortEdit(EnLineEdit): def copy_to_authors(self): aus = self.current_val + meth = tweaks['author_sort_copy_method'] if aus: ln, _, rest = aus.partition(',') if rest: - au = rest.strip() + ' ' + ln.strip() - self.authors_edit.current_val = [au] + if meth in ('invert', 'nocomma'): + aus = rest.strip() + ' ' + ln.strip() + self.authors_edit.current_val = [aus] def auto_generate(self, *args): au = unicode(self.authors_edit.text())