View Single Post
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