Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Devices

Notices

Reply
 
Thread Tools Search this Thread
Old 01-15-2013, 08:56 AM   #1
GeoffR
Wizard
GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.
 
GeoffR's Avatar
 
Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
Displaying multiple authors (on Kobo Glo)

The problem I have is that for a books with more than one author, with each author listed seperated by ampersands in Calibre's edit metadata author(s) field, only the first author is being displayed on my Kobo Glo.

I have found a rough workaround, which is to enter all authors in the field without using ampersands to seperate them, which requires disabling Calibre's automatic replacement of "and" with an ampersand via the "Splitting multiple author names" tweak.

Although this works exactly as I want on the Kobo (and sorts correctly), it is not ideal because I can't automatically set author_sort from authors when editing metadata in Calibre, I have to enter the author_sort manually for each book.

I think the real solution might be enter the authors seperated by ampersands and let Calibre split the author names as it wants, and then use a metadata plugboard to convert the authors field to the format that displays properly on the Kobo when the metedata is sent to the device. But exactly how to do this is escaping me.

In summary, I think what I want to do is take the authors field in the format:

First1 Last1 & First2 Last2 & ... & First(n) Last(n)

and convert it via a plugboard to the format:

First1 Last1, First2 Last2, ..., First(n-1) Last(n-1) and First(n) Last(n)

Any clues how I can do this, or is there a better solution?
GeoffR is offline   Reply With Quote
Old 01-15-2013, 08:44 PM   #2
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,908
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
This was discussed in the Kobo forum in https://www.mobileread.com/forums/sho...d.php?t=202664. There is an issue that the Kobo devices doesn't read the multiple creator elements in the opf file. If the full author list is in the first creator element, it handles that correctly. I couldn't see a way to get calibre to write the full author list as the text or this element.
davidfor is offline   Reply With Quote
Old 01-15-2013, 10:18 PM   #3
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,779
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@david: You can have the kobo driver do that when sending files to the device, you will need to modify the opf directly using lxml however, since calibre's opf handling code is going to put multiple authors into separate tags.
kovidgoyal is online now   Reply With Quote
Old 01-15-2013, 11:00 PM   #4
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,908
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
@Kovid: I was afraid you were going to say that I suppose I was hoping for a way to do it via a plugboard. I'll have a look through the code. Do you know of an example similar to this?

@anyone: For my curiosity, how do other devices handle this?
davidfor is offline   Reply With Quote
Old 01-15-2013, 11:15 PM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,779
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Cant think of an example, but the basic procudure is to follow the set_metadata() function in metadata/epub.py. Something like

Code:
reader = get_zip_reader(stream, root=os.getcwdu())
opf = reader.opf
for author in opf.authors_path(opf.metadata):
     author.getparent().remove(author)
and so on (see the authors()->fset function in opf2.py)
and then do
newopf = StringIO(opf.render())
do the replacing as in set_metadata()
kovidgoyal is online now   Reply With Quote
Old 01-16-2013, 12:08 AM   #6
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,908
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
@Kovid: Thanks, that will make it easier.
davidfor is offline   Reply With Quote
Old 01-16-2013, 02:44 AM   #7
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,704
Karma: 6658935
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Why can't you do this with a metadata plugboard? Something like
Code:
{authors:'re($, ' & ', ', ')'}
will change all the ampersands to commas. It doesn't deal with the apparent exception -- changing the last ampersand to ' and ', but this should be possible using a nested re. Something like
Code:
{authors:'re(re($, '(.*) & '. '\1 and'), ' & ', ', ')'}
chaley is offline   Reply With Quote
Old 01-16-2013, 04:16 AM   #8
GeoffR
Wizard
GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.
 
GeoffR's Avatar
 
Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
Quote:
Originally Posted by chaley View Post
Why can't you do this with a metadata plugboard? Something like
Code:
{authors:'re($, ' & ', ', ')'}
will change all the ampersands to commas. It doesn't deal with the apparent exception -- changing the last ampersand to ' and ', but this should be possible using a nested re. Something like
Code:
{authors:'re(re($, '(.*) & '. '\1 and'), ' & ', ', ')'}
Thanks chaley! I just made minor corrections (space after and, replace period with comma), and it seems to work exactly right:

Code:
{authors:'re(re($, '(.*) & ', '\1 and '), ' & ', ', ')'}
GeoffR is offline   Reply With Quote
Old 01-18-2013, 01:49 AM   #9
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,908
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
@GeoffR: As you have a solution via the plugboard, I think I will hold off on adding this to the driver at the moment. If something changes, or enough people ask for it, I'll look at it then.
davidfor is offline   Reply With Quote
Old 03-31-2013, 10:48 AM   #10
jbaumann
Zealot
jbaumann began at the beginning.
 
Posts: 106
Karma: 10
Join Date: Nov 2011
Device: Multiple Kobos, multiple Kindles
Hi,

I tried this solution, but to no avail. Whatever I do, it only provides "surname, firstname" of one of the authors.

Is there somewhere else where I might look?

Cheers, Joe
jbaumann is offline   Reply With Quote
Old 03-31-2013, 08:54 PM   #11
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,908
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by jbaumann View Post
I tried this solution, but to no avail. Whatever I do, it only provides "surname, firstname" of one of the authors.

Is there somewhere else where I might look?
If you have the plugboard set-up correctly when you first send the book, it should work. Can you post or send the book to me? I would like to see the copy after it has been put on the device. If you can't post it here for copyright reasons, send me PM for an email address to send it to.
davidfor is offline   Reply With Quote
Old 04-01-2013, 08:01 AM   #12
jbaumann
Zealot
jbaumann began at the beginning.
 
Posts: 106
Karma: 10
Join Date: Nov 2011
Device: Multiple Kobos, multiple Kindles
Hello David,

thank you very much for looking into the problem. I've sent you a PM and can send you the book later.

If I look into the embedded content.opf, then the file on the Kobo looks like this:
<dc:creator opf:file-as="Fletcher, Jessica &amp; Bain, Donald" opf:role="aut">Fletcher, Jessica</dc:creator>
<dc:creator opf:role="aut">Bain, Donald - Murder, She Wrote 01</dc:creator>

and the author shown on the Kobo is "Fletcher, Jessica".

The original file in my calibre library has the following info in the embedded content.opf:
<dc:creator opf:file-as="Fletcher, Jessica" opf:role="aut">Jessica Fletcher</dc:creator>

In Calibre I have entered:
Gin and Daggers
Donald Bain & Jessica Fletcher
Murder, She Wrote[1]

Cheers, Joachim
jbaumann is offline   Reply With Quote
Old 04-01-2013, 08:15 AM   #13
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,908
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Joachim,

That makes me think you don't have the metadata plugboard set-up correctly. You should have a plugboard for epubs and the KoboTouch (or any device). The source template needs to be set to what GeoffR has above, and the destination field set to "authors".
davidfor is offline   Reply With Quote
Old 04-01-2013, 08:16 AM   #14
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,704
Karma: 6658935
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by jbaumann View Post
Hello David,

thank you very much for looking into the problem. I've sent you a PM and can send you the book later.

If I look into the embedded content.opf, then the file on the Kobo looks like this:
<dc:creator opf:file-as="Fletcher, Jessica &amp; Bain, Donald" opf:role="aut">Fletcher, Jessica</dc:creator>
<dc:creator opf:role="aut">Bain, Donald - Murder, She Wrote 01</dc:creator>

and the author shown on the Kobo is "Fletcher, Jessica".

The original file in my calibre library has the following info in the embedded content.opf:
<dc:creator opf:file-as="Fletcher, Jessica" opf:role="aut">Jessica Fletcher</dc:creator>

In Calibre I have entered:
Gin and Daggers
Donald Bain & Jessica Fletcher
Murder, She Wrote[1]

Cheers, Joachim
This tells me that your plugboard is incorrect in some way. The series is being added at the end of the author string, which should not happen.

Could you post all the plugboard templates exactly as written in preferences -> plugboards? The best way to do that is to click on the plugboard expression in the existing plugboards box, copy that to the clipboard (ctrl C on windows), then paste the results in a post.

Last edited by chaley; 04-01-2013 at 09:29 AM. Reason: series, not title, is being added
chaley is offline   Reply With Quote
Old 04-01-2013, 08:29 AM   #15
jbaumann
Zealot
jbaumann began at the beginning.
 
Posts: 106
Karma: 10
Join Date: Nov 2011
Device: Multiple Kobos, multiple Kindles
Ok, then it seems that I somehow incorrectly copied/edited the plugboard. Here is the info of the plug-in configuration and the plugboard:

Plugin KoboTouch
Read metadata from files on device
Use sub directories
Save template:
{author_sort} - {series}{series_index:0>2s| | - }{title}

column for bookshelves
series, author_sort, #classification

Delete Empty Bookshelves
Create Bookshelves
Upload covers for books
Set Series information

Metadata Plugboard
any format
KOBOTOUCH
Source template
{author_sort:'re(re($, '(.*) & ', '\1 and '), ' & ', ', ')'}
Destination field
author sort
Source template
{authors:'re(re($, '(.*) & ', '\1 and '), ' & ', ', ')'}
Destination field
authors

The first template (author_sort) I tested only as a last resort, but it didn't change a thing.

Result:
The author shown for the book is "Fletcher, Jessica".
The bookshelf is "Bain, Donald & Fletcher, Jessica".

I would be very happy if I set it up incorrectly :-)

Regards, Joe
jbaumann is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Glo Cover not displaying on Kobo Glo Bronwyn Kobo Reader 6 12-18-2013 12:00 AM
Multiple authors issue with Kobo Arc MarcB Kobo Reader 0 01-07-2013 07:17 PM
Glo Can kobo glo run android app such as nook glo? suspect Kobo Developer's Corner 1 12-28-2012 11:25 PM
Glo Kobo Glo Freezes multiple time per day Manfred L Kobo Reader 4 11-26-2012 12:54 AM
Kobo & multiple authors Medieval Guy Calibre 7 07-02-2010 04:32 PM


All times are GMT -4. The time now is 10:25 PM.


MobileRead.com is a privately owned, operated and funded community.