CSV Catalog Output: Separate multiple authors with & instead of comma. Fixes problems when the author name contains commas.

This commit is contained in:
Kovid Goyal 2016-07-14 14:46:32 +05:30
parent e61b0829eb
commit 4a0d5703c9

View File

@ -55,6 +55,7 @@ class CSV_XML(CatalogPlugin):
from calibre.utils.html2text import html2text
from calibre.utils.logging import default_log as log
from lxml import etree
from calibre.ebooks.metadata import authors_to_string
self.fmt = path_to_output.rpartition('.')[2]
self.notification = notification
@ -133,7 +134,9 @@ class CSV_XML(CatalogPlugin):
for format in item:
fmt_list.append(format.rpartition('.')[2].lower())
item = ', '.join(fmt_list)
elif field in ['authors', 'tags']:
elif field == 'authors':
item = authors_to_string(item)
elif field == 'tags':
item = ', '.join(item)
elif field == 'isbn':
# Could be 9, 10 or 13 digits, with hyphens, possibly ending in 'X'