Swap author option splits name at comma if comma found, otherwise splits at first space

This commit is contained in:
Starson17 2010-01-20 10:01:29 -05:00
parent e71b23e5c3
commit aa589bea38

View File

@ -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(' ', 1)
if len(parts) > 1:
t = parts[-1]
parts = parts[:-1]