View Single Post
Old 06-13-2010, 12:13 PM   #13
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
I will repeat what Kovid said in different words and somewhat more technically.
Great. That's what I'm looking for - understanding, not a discussion of what it should or shouldn't do, but an understanding of the technical constraints.

Quote:
When calibre produces a list of authors, it does so by scanning the authors table.
At what point would it be doing this? Say the content server has a search active for all books with title:Nightmare. Won't it find those book ids first? Then suppose the user selects the author column to sort. Doesn't it know the author_sort for those book ids? I assumed step 1 is to always find book ids, not authors.

Quote:
At this point we have authors, but no books, so we don't have author_sort. Sorting will be by author, as it is written. Now assume you want the books by an author. Calibre looks up all the books that reference that author. We now have a list of books, each with an author sort, but what can we do with it? Nothing, because the list is book within author, not author within book.
I assumed it has the book ids for all matches in the author search. This seems like a simple SQL query. Obviously I'm missing something.

Quote:
There are only two ways to solve this problem correctly: 1) store authors so that they produce the order you want naturally (this is what I do), or store an editable author sort field for each author *in addition to* each book. The first the users can do, the second takes development.
If Calibre was doing it this way in the content server, then the first step would be to search the authors table. Let's say that we search for author:tom and we have a book that has authors = 'Tom Jones & Tom Smith' We'd find both authors, then we'd want the books for those authors, and we'd find the same book twice. But that's not what I see in the content server. Sorting by author doesn't give you two references to the same book merely because you get two matches on the two author names. That implies to me that you start with the book ids, not the authors and you sort the books.

What am I missing? Do you need to point me to code where this is done?

Let me ask it another way - simpler - if it's done in the main GUI, why not in the content server? Is there a hack in the GUI that's been removed from the CS?


Quote:
I'll stop now, or I will yet again get into a rant about name order assumptions and difficulties ...
Polite and informative rants are always welcome
Starson17 is offline   Reply With Quote