Thread: Marvin 3.0
View Single Post
Old 06-22-2016, 01:48 PM   #170
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by chrisridd View Post
OK, I think I see what you mean. I haven't used Marvin very much so far, nor with many books, so this is not really something I've used. Also there's a lot of text in your posts to read through to find the cogent points.

I'd agree though, sorting "Ernest Hemingway" before "Bill Shakespeare" seems odd. How would you solve it though? Splitting names up algorithmically is non-trivial (maybe impossible) with names from different cultures. EPUB avoids this problem IMO by using opf:file-as values to let the application know how to sort, but in this case you're talking about multiple books by the same author which may have different opf:file-as values. How would you choose to sort that author?
Quote:
Originally Posted by chrisridd View Post
Calibre fills the "Author sort" field from the opf:file-as attribute I was mentioning.

Clearly there's a simple way to handle an author without an opf:file-as attribute.

What there is not is a simple way to handle the same author with different opf:file-as attributes.

eg:

book1 by "Ernest Hemingway" author sort "Hemingway, Ernest"

book2 by "Ernest Hemingway" author sort "Hemingway, E"

book3 by "Ernest Hemingway" author sort "Heminway, Ernest"

book4 by "Ernest Hemingway" no author sort

If Marvin saw these 4 books by the same author which of the "author sort" values would it use?
Those books have broken metadata, and every application out there will incorrectly sort them as a result. In the book list.
That is why metadata maintenance is required when you have books from incompetent sources.

Author sort exists in order to be respected. If the book's metadata is going to lie about the author sort, it could lie about the author as well, and claim the book was written by Isaac Vainio, and then what should Marvin use?
If a book doesn't have an author sort value, you could do worse than defaulting to standard English and swapping around the last name and the first thru second-last (might be the same) name(s).

Given, that author sort is a non-existent metadata field that really just means "how to generate a lastname-based sort order for the author field", the only reason it is visible in a metadata editor like calibre is for the explicit purpose of modifying it.

And that I believe, is exactly what Marvin does in the book list.

...

However.
In the specific case of a listing of available authors, you probably don't want to show multiple versions of the same author just because they are clearly different authors based on the incompetent author sort value.
And you cannot use the author sort value as a sorting key, because there are multiple versions of it. (In the book list, the multiple versions apply to different books, obviously.)

So there are really only two viable solutions:
  • Sort by author.
  • Generate a sort order independent of author sort, which doesn't exist anyway and isn't applicable regardless.

Oh, @Faterson, guess which one calibre uses? calibre doesn't use {author_sort} to generate an author listing in the Tag Browser. It uses the same algorithm usually used to "Set author sort from author", to derive a sort key for the Tag Browser. Irrespective of what may or may not exist in the big master table of {author_sort} values.

...

@kguil could do the same thing in Marvin. But as @chrisridd pointed out, that is non-trivial to implement across cultures and languages. Case in point -- calibre just assumes standard American English names.
And whatever algorithm used, that would cost additional processor cycles each and every time a new author got added, require an additional cache, and still not make everyone happy.
eschwartz is offline   Reply With Quote