02-23-2011, 07:02 AM | #1 |
Sigil developer
Posts: 1,274
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) |
02-23-2011, 08:38 AM | #2 |
creator of calibre
Posts: 44,321
Karma: 23661992
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. |
02-23-2011, 10:12 AM | #3 |
Sigil developer
Posts: 1,274
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.
|
02-23-2011, 12:01 PM | #4 |
Grand Sorcerer
Posts: 11,932
Karma: 7208979
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' |
02-23-2011, 12:12 PM | #5 |
Sigil developer
Posts: 1,274
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.
|
02-23-2011, 12:17 PM | #6 |
Grand Sorcerer
Posts: 11,932
Karma: 7208979
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. |
02-23-2011, 01:41 PM | #7 |
Sigil developer
Posts: 1,274
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.
|
|
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 |