Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 01-09-2022, 07:20 AM   #1
citronalco
Enthusiast
citronalco began at the beginning.
 
Posts: 33
Karma: 10
Join Date: Jul 2018
Device: PocketBook Touch HD
Metadata plugin: How to set "author_sort_map"?

I'm developer of a metadata plugin.

My metadata source delivers author names in the style "lastname, firstname".
I'd like to have it in Calibre as "firstname lastname" without loosing the already given correct sort order.

So I do not want to simply use a regex to switch author names to "firstname lastname" and let Calibre afterwards guess what's the correct sort order, as I obviously already have it.
As far as I understand I could use "author_sort_map" to avoid the guessing, but regardless what I try, the dict gets ignored.

I've added "author_sort_map" to the "touched_fields":
Code:
touched_fields = frozenset(['title', 'authors', 'author_sort_map','languages',....
So when doing something like this:
Code:
mi = Metadata(
    "Example Book Title",
    ['Anna Nym', 'Siggi Schwarz']
)
mi.author_sort_map = { "Anna Nym": "It Works", "Siggi Schwarz": "Yippie" }
I'd expect to see in the metadata editor:
  • Authors: Anna Nym & Siggi Schwarz
  • Author sort: It Works & Yippie

But what I get is the usual:
  • Authors: Anna Nym & Siggi Schwarz
  • Author sort: Nym, Anna & Schwarz, Siggi

Any hints why author_sort_map is ignored?
citronalco is offline   Reply With Quote
Old 01-09-2022, 08:21 AM   #2
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: 45,185
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Just set author_sort, it can contain multiple autors separated by &
kovidgoyal is offline   Reply With Quote
Old 01-09-2022, 11:35 AM   #3
citronalco
Enthusiast
citronalco began at the beginning.
 
Posts: 33
Karma: 10
Join Date: Jul 2018
Device: PocketBook Touch HD
This works, thank you very much!
citronalco is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to wipe out "series" field from within my metadata source plugin lrpirlet Development 2 12-30-2021 03:08 PM
Plugin "Read MP3 Audiobook Metadata" error installing gandoe Plugins 1 08-22-2021 12:36 PM
What to do about "Failed to set metadata for the PDF format" on export? halloleo Library Management 5 12-31-2020 02:43 PM
Calibre 4.0 - qt.qpa.pluginCould not load the Qt platform plugin "xcb" in "" even tho PaceyIV Calibre 3 10-04-2019 08:58 PM
is it possible to set mobipocket "subject" metadata from calibre? rheostaticsfan Calibre 3 05-20-2010 08:44 AM


All times are GMT -4. The time now is 01:39 AM.


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