View Single Post
Old 09-06-2010, 03:43 AM   #8
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: 12,480
Karma: 8025702
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by dwanthny View Post
I just switched mine to copy, then I restarted calibre, then I selected 5 books went to bulk edit metadata, checked Automatically set Author sort, then clicked OK. I would have expected the Author field to be copied to the author_sort field but nothing changed.
A note of explanation:

Except in rare cases (which do not include edit metadata), when the author_sort field is automatically built, the process is as follows:
Code:
A) Clear (empty) the book's current author_sort value.
B) For each author of a book, in author order:
  1) Look up that author in the database.
  1.a) Author exists -- retrieve his/her individual author_sort string
  1.b) Author does not exist. 
  1.b.1) Add the author
  1.b.2) Compute that author's author_sort value, taking the tweak into consideration
  1.b.3) Save the computed value in the database with the author
  1.b.4) pass the computed value to the next step
  2) add the retrieved individual author_sort to the end of the book's author_sort, separated by ' & '
C) Write the book's new author_sort value to the database
This process explains why changing the tweak has the effects you saw. Recomputing the author_sort in edit_metadata simply used the values that already exist. Adding a new book might cause a new author to be added, and (as seen above) that would cause the tweak to be used.

After changing the tweak, you should open the manage authors dialog and click 'Recalculate all author sort values'. Calibre will do what you ask, taking the tweak into consideration. Next, scan down the list to see if any authors have the wrong value, which will depend on how you want to handle sorting of complex last names. For example, some people prefer 'von Braun, Werner' to be sorted under 'v', while others want it sorted under 'B'.
chaley is offline   Reply With Quote