mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Swap author option splits name at comma if comma found, otherwise splits at first space
This commit is contained in:
parent
e71b23e5c3
commit
aa589bea38
@ -134,7 +134,10 @@ def metadata_from_filename(name, pat=None):
|
|||||||
mi.authors = aus
|
mi.authors = aus
|
||||||
if prefs['swap_author_names'] and mi.authors:
|
if prefs['swap_author_names'] and mi.authors:
|
||||||
def swap(a):
|
def swap(a):
|
||||||
parts = a.split()
|
if ',' in a:
|
||||||
|
parts = a.split(',', 1)
|
||||||
|
else:
|
||||||
|
parts = a.split(' ', 1)
|
||||||
if len(parts) > 1:
|
if len(parts) > 1:
|
||||||
t = parts[-1]
|
t = parts[-1]
|
||||||
parts = parts[:-1]
|
parts = parts[:-1]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user