View Single Post
Old 06-27-2019, 05:20 PM   #5
thiago.eec
Wizard
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 1,233
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
Quote:
Originally Posted by Ubiquity View Post
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())
thiago.eec is offline   Reply With Quote