mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Make the new author_sort -> author try to split the author_sort into its individual authors, then handle them one by one.
This commit is contained in:
parent
688c1a3f64
commit
e8592b2f90
@ -280,11 +280,16 @@ class AuthorSortEdit(EnLineEdit):
|
|||||||
aus = self.current_val
|
aus = self.current_val
|
||||||
meth = tweaks['author_sort_copy_method']
|
meth = tweaks['author_sort_copy_method']
|
||||||
if aus:
|
if aus:
|
||||||
ln, _, rest = aus.partition(',')
|
ans = []
|
||||||
|
for one in [a.strip() for a in aus.split('&')]:
|
||||||
|
if not one:
|
||||||
|
continue
|
||||||
|
ln, _, rest = one.partition(',')
|
||||||
if rest:
|
if rest:
|
||||||
if meth in ('invert', 'nocomma', 'comma'):
|
if meth in ('invert', 'nocomma', 'comma'):
|
||||||
aus = rest.strip() + ' ' + ln.strip()
|
one = rest.strip() + ' ' + ln.strip()
|
||||||
self.authors_edit.current_val = [aus]
|
ans.append(one)
|
||||||
|
self.authors_edit.current_val = ans
|
||||||
|
|
||||||
def auto_generate(self, *args):
|
def auto_generate(self, *args):
|
||||||
au = unicode(self.authors_edit.text())
|
au = unicode(self.authors_edit.text())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user