Fix #879495 (download metadata)

This commit is contained in:
Kovid Goyal 2011-10-22 18:27:51 +05:30
parent 55cb29e150
commit 52f1459a22

View File

@ -285,14 +285,15 @@ class Source(Plugin):
if authors: if authors:
# Leave ' in there for Irish names # Leave ' in there for Irish names
remove_pat = re.compile(r'[,!@#$%^&*(){}`~"\s\[\]/]') remove_pat = re.compile(r'[!@#$%^&*(){}`~"\s\[\]/]')
replace_pat = re.compile(r'[-+.:;]') replace_pat = re.compile(r'[-+.:;,]')
if only_first_author: if only_first_author:
authors = authors[:1] authors = authors[:1]
for au in authors: for au in authors:
has_comma = ',' in au
au = replace_pat.sub(' ', au) au = replace_pat.sub(' ', au)
parts = au.split() parts = au.split()
if ',' in au: if has_comma:
# au probably in ln, fn form # au probably in ln, fn form
parts = parts[1:] + parts[:1] parts = parts[1:] + parts[:1]
for tok in parts: for tok in parts: