mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-02-10 04:04:31 +01:00
Fix #4620 (swap_author_names revised to eliminate trailing comma and split/swap at first comma or space)
This commit is contained in:
commit
d83a9104fd
1 changed files with 4 additions and 1 deletions
|
|
@ -134,7 +134,10 @@ def metadata_from_filename(name, pat=None):
|
|||
mi.authors = aus
|
||||
if prefs['swap_author_names'] and mi.authors:
|
||||
def swap(a):
|
||||
parts = a.split()
|
||||
if ',' in a:
|
||||
parts = a.split(',', 1)
|
||||
else:
|
||||
parts = a.split(None, 1)
|
||||
if len(parts) > 1:
|
||||
t = parts[-1]
|
||||
parts = parts[:-1]
|
||||
|
|
|
|||
Loading…
Reference in a new issue