Quote:
Originally Posted by Ubiquity
I wouldnot say that my artist string is in list form. Fetching it and joining to reult string which initializes Metadata structure
Code:
authors = root.xpath('//h2[@class="authornames"]/span/a/text()')
if authors:
authors = ' & '.join(authors).strip()
.
.
.
mi = Metadata(title, authors)
|
What
@eschwartz said is that calibre expects authors as a list, so you should format it as such. If you pass a string, then you will have this odd behavior you described.
So, you should initialize your variable as a list, and then append the values, like this example:
Code:
authors = []
for author_node in author_nodes:
authors.append(author_node.text_content().strip())