Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 09-01-2019, 04:33 PM   #1
evank
Junior Member
evank began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jul 2018
Device: android phone
Custom sort template for authors and titles?

I suspect I may just be missing it, but is there a place I can put a template (or, failing that, some Python code) to customize how the Title sort and Author sort for books is computed?

Here's my situation:

For authors, I've been adding a "tag" onto the author name for non-author names. For example
Carlos Garcia & Bob Jones (tr) & Carol Smith (intro)
meaning that the book was writting by Carlos Garcia and translated by Bob Jones, with an introduction written by Carol Smith. When sorting the book by author, I just want "Garcia, Carlos". Currently, it gives "Garcia, Carlos & Jones, Bob & Smith, Carol", so I know it's doing some processing, but I'd like to completely ignore any tagged names (unless there are no untagged names, in which case I'd like to use all that have the same tag as the first, usually "ed" for "editor").

For titles, I've got a separate "#edition" column, and I'd like to add that and suppress any subtitle. That is, for
  • title: The Title: With a Subtitle
  • #edition: 2nd ed.

I'd like the sort title to be "The Title (2nd ed.)".

I know that I can create computed columns, but that makes the UI tricky to use, since I can't edit the computed column directly. It would be easier if I could just add a value somewhere in the tweaks.

Any ideas?
evank is offline   Reply With Quote
Old 09-01-2019, 10:35 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,828
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
I just put those in the Title field:
title (ed 2) (title_sort ignores the ( ) stuff )

FWIW Calibre biases column sorts (IIRC default is 3 levels)

Sort on your edition column, then sort on title

If your device uses metadata: use the plugboard, just put {title} {#edition} with Title as the destination
theducks is offline   Reply With Quote
Old 09-03-2019, 06:30 AM   #3
Gary_M_Mugford
Groupie
Gary_M_Mugford has a complete set of Star Wars action figures.Gary_M_Mugford has a complete set of Star Wars action figures.Gary_M_Mugford has a complete set of Star Wars action figures.
 
Gary_M_Mugford's Avatar
 
Posts: 180
Karma: 299
Join Date: Jul 2010
Location: Brampton ON
Device: Kobo, Kindle3
You might refine theducks a tad by making the {#edition} segment {#edition:ifempty(NA)} instead. That leaves something there if there is no edition, rather than an extra space which can look a little off. I assume this is ONE of your plugboards, since not everything has an edition. But if you've gone to the extent of creating and maintaining edition fields, this extra step might be good.
Gary_M_Mugford is offline   Reply With Quote
Reply

Tags
sorting


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using built-in template functions in a custom template function ilovejedd Library Management 4 01-28-2018 12:20 PM
Titles by dual Authors, Sort doesn't like. Woodssi Library Management 3 06-30-2015 03:22 PM
Manual Sort or Sort by custom column Dethmaul Marvin 2 04-28-2014 11:54 AM
setting authors.name to authors.sort richardsugg Library Management 2 01-18-2013 03:50 PM
Is it possible to sort a custom column like authors or title? arspr Library Management 2 03-15-2011 04:44 PM


All times are GMT -4. The time now is 04:18 PM.


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