Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 02-23-2011, 07:02 AM   #1
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
Using author_sort, title_sort names

While creating a list of Calibre columns to show to users to allow customization, all the regular ones (authors, series, tags, ...) have names associated with them in field_metadata.py (Author(s), Series, Tags... But 'author_sort' doesn't.

I've noticed that 'Author Sort' doesn't appear on the list of columns you can display on the main GUI (e.g. in Preferences->Add your own columns).

"Author Sort" is used in the Edit Metadata screen for a book, so its obviously stored somewhere (though it appears to be hard coded in fetch_metadata). ('title_sort' and 'isbn' are the other fields on Edit Metadata that don't appear as column selections).

Clearly some fields are 'internal', but these 3 seemed inconsistent with the others that are displayed to the user at some point.

For my plugin, I can just ignore author_sort on the basis that it isn't a column they see in the main GUI and the user can simply create a custom column using that value if they really need it. (I can display it for them to use - but they would see 'author_sort' instead of 'Author Sort' unless I hard code the display, which I'll consider)
meme is offline   Reply With Quote
Old 02-23-2011, 08:38 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,844
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
See http://calibre-ebook.com/user_manual...es-and-sorting

author and title sort values are, as their names suggest for sorting, not for displaying to the user.
kovidgoyal is offline   Reply With Quote
Advert
Old 02-23-2011, 10:12 AM   #3
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
I think then I'll just ignore author_sort in my list. (If I hardcode it and someone names their header Author Sort then I have to deal with that as well). Simplifies the approach.
meme is offline   Reply With Quote
Old 02-23-2011, 12:01 PM   #4
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,734
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
If you use db2.get_metadata, both author_sort and title_sort are available in the returned dict.

In field_metadata, title_sort is called 'sort'.

Last edited by chaley; 02-23-2011 at 12:15 PM. Reason: Fix error in what is called 'sort'
chaley is offline   Reply With Quote
Old 02-23-2011, 12:12 PM   #5
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
I see the values there (and I think its title_sort that is 'sort') - but the issue is there is no 'name' assigned to author_sort, unlike say authors, in field_metadata.py. As mentioned, I'll just ignore this - the user doesn't see a column labelled Author Sort, so I won't display it as a column they can use in the plugin.
meme is offline   Reply With Quote
Advert
Old 02-23-2011, 12:17 PM   #6
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,734
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Ahh.. my bad. I didn't understand the problem.

Do you display composite columns? If so, then you can use them as people do on the library view to see things like author_sort, isbn, etc.
chaley is offline   Reply With Quote
Old 02-23-2011, 01:41 PM   #7
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
Yes, I use composite/custom columns so the user has complete flexibility in the collections they create.
meme is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ERROR:{author_sort:.2} - {title} mobijupp Calibre 2 01-07-2011 11:17 PM
title_sort in metadata edit dialogue phenomshel Calibre 9 12-27-2010 12:39 AM
Little bug in bgcolor for author_sort? Coleccionista Calibre 4 11-12-2010 10:57 AM
Showing author_sort column in main grid LARdT Calibre 3 09-20-2010 03:26 AM
What am I missing? (author_sort) megachirops Calibre 12 09-06-2010 11:15 AM


All times are GMT -4. The time now is 12:22 AM.


MobileRead.com is a privately owned, operated and funded community.