View Single Post
Old 11-07-2011, 04:11 PM   #15
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by chaley View Post
Starson17 and I have tried several ways to create a book with an empty author_sort and have not been able to do it.

If someone has a way to enter a new author or import a new book and have the author_sort remain empty, I would like to see it.
I would like to emphasize Charles' comments. I recall looking closely at the code for adding a book to the calibre library. If calibre can't find an author, it inserts the local language word for "Unknown" as the author. The author name, whatever it is, is converted to an author_sort name. For a long time, author_sort was relatively inaccessible. It no longer is inaccessible. You are perfectly free to force it to be null, and if you do, you will get the error of the OP.

Neither Charles nor I can find a way to accidentally make it null during an import (except as below). There may be one (other than below), and if there is, that's a bug.

I'll also comment that author_sort is defined for a book, not an author. There is a corresponding field for the author called simply "sort." You can see "author_sort" in a book record. You can see the "sort" field for the author in Manage Authors. The sort field in the author table is used for the author_sort field in the book table if the author was previously defined.

If the OP has accidentally nulled the sort field in the author's table for the "Unknown" author (using Manage Authors), it will produce a null author_sort field for each newly added Unknown author. This needs to be fixed with Manage Authors and all old books with this problem also need fixing to solve the OP's problem. I just tested it to confirm this. Nulling the sort field for the author "Unknown" produces null author_sort fields for new books with unknown authors.

This problem applies to all authors, not just the special Unknown, but it's more likely that someone tried to blank out the Unknown author than any other. Generally, calibre will catch any attempt to null the author field and replace it with Unknown, but it's possible that there is some situation where calibre caught the attempt to blank the author field (which is prohibited due to the filename requirements of the library), but didn't catch the blank "author_sort" or "sort" fields, which are both permitted.

Last edited by Starson17; 11-07-2011 at 04:21 PM.
Starson17 is offline   Reply With Quote