View Single Post
Old 04-01-2010, 01:11 PM   #11
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,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Starson17 View Post
Having worked on the code, I know a bit about this. Calibre considers each author to be an item of metadata called "author" in another chunk of metadata (a list) called "authors." Each author is independently linked to the book. Searches for an author will find all of that author's books regardless of whether he's a single or joint author and regardless of whether he's first or last in a list.
To add a bit more...

As Starson17 said, author names are stored as individual records. Author lists are a set of words separated by certain magic 'words' such as 'and', 'with', and '&'. Thus you should enter each author in the list as a complete name and separate the authors with one of the magic words. If you do not follow this convention, then some authors will be missing or incorrect. That may be OK (it certainly is for GRiker), or it may not be.

When you ask for your books to be sorted by author, they are not in fact sorted by author but are instead sorted by author_sort. Author_sort is not stored the same way as author. Instead of being an individual record per author, author_sort is kept as a single string per book. When you add a book or press the 'compute author_sort' button in the edit metadata dialog, by default calibre looks at each author in order, attempts to guess the last name, generates a guessed 'lastname, firstname' string, then adds this string to the author_sort field for the book. There are two interesting consequences:

1. calibre can get it wrong, and will get it wrong in the case of names like 'fred smith esq'. This example will become, 'esq, fred smith'.
2. you can change author_sort however you wish without having any effect on the real author name. This permits you to correct any guessing errors, and also lets you choose arbitrary strings for sorting.

Finally, a few people (I am one of them) choose to maintain author names in library order ('ln, fn') instead of spoken order ('fn ln'). If you choose this route, you will need to set a 'tweak' in Calibre so that it won't carefully undo your work and generate nonsense author_sort values. See this post for details on this.

Have fun.
chaley is offline   Reply With Quote