![]() |
#16 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,200
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
@chaley: One way to do this is to add another operator to the search language that causes the search expression to be run on the sort version. Either another prefix character, or a second char after ~
|
![]() |
![]() |
![]() |
#17 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,339
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Recomputing the string has some benefits, principally that the pattern would be applied to the same string computed in get_categories. However, the recomputation would likely be slower than applying the complex regexp. Another alternate is to generate an =match for each series in a group, separated by 'or'. I think this would be very slow, but it would work as long as we don't run into length limitations. We could also add "series_sort" to the db and field_metadata. This would speed up get_categories at the cost of loading the value when "meta" is evaluated. We would need to add an update trigger to write the value in the DB whenever the record is updated. This solution would also permit exposing series_sort in edit metadata, but that might create more problems than it is worth. My guess is that the complex regexp is the easiest to build solution with the best performance. Next would be a new column in the books table, set by a db upgrade and maintained by a trigger. This is easy for the tag browser, but would require all the kerfuffle to update the database and change field_metadata. It might also require changing OPF, but at first reflection I think not. If the field is not exposed, then there is no reason to pass it around. Thoughts? |
|
![]() |
![]() |
Advert | |
|
![]() |
#18 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,200
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The problem with the complex regex is what happens for non english languages? Seems to me (without an awful lot of thought) that using a special operator would be more robust, and also have other applications.
There may actually be no need for database changes. The series_sort can be maintained as a pure in memory cache, populated on demand, and visible *only* in database2.py |
![]() |
![]() |
![]() |
#19 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,339
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Possible implementation pushed to launchpad. Discussion taken to email.
|
![]() |
![]() |
![]() |
#20 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,339
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
The fix will be in the next release.
We added a "series_sort" search term. Clicking on a letter in the tag browser now generates searches of the form series_sort:"~^[D]" if library order is being used, meaning that the letter must be first in the sort value, not the series value. In addition, there is a new template function "series_sort()" that returns the sort value, provided for those who might want to show the value in a column or use the value in a template. |
![]() |
![]() |
Advert | |
|
![]() |
#21 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,913
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
It is just amazing the effort you both put in to Calibre.
A very big Thank you. |
![]() |
![]() |
![]() |
#22 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,812
Karma: 26912940
Join Date: Apr 2010
Device: sony PRS-T1 and T3, Kobo Mini and Aura HD, Tablet
|
How nice for me
![]() Thanks a lot. Helen |
![]() |
![]() |
![]() |
#23 |
Member
![]() Posts: 20
Karma: 10
Join Date: Apr 2012
Device: Kindle
|
Hello,
My first query after two happy years as a Calibre user ![]() I am experiencing some problems in having my Kindle show that a book is the prequel in a series. In other words the desired Kindle visualization should be 'series [00] - title' (following titles in the series are correctly shown as 'series [01]- title' and so on), but with the current Calibre setting my Kindle shows only the title whereas the series and the relevant number are nowhere to be seen. The plugboard used is {series:|| }{series_index:0>2s|[|] - }{title}. The Calibre series column field associated to the prequel title shows 'series [0]', and does not accept any edit to make it read like 'series [00]'. What am I doing wrong? Maybe the plugboard needs some editing? ![]() |
![]() |
![]() |
![]() |
#24 |
eBook Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 85,544
Karma: 93383099
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
|
I'm guessing that a value of "0" is being taken as the same as an empty value. Try changing it to something like "0.1" and see if that works.
|
![]() |
![]() |
![]() |
#25 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,913
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
![]() In your template they are Digit Characters That is what the 0>2s causes to be padded to 2 digits I wonder if the [ are causing problems ![]() |
|
![]() |
![]() |
![]() |
#26 | |
Member
![]() Posts: 20
Karma: 10
Join Date: Apr 2012
Device: Kindle
|
Quote:
I found that plugboard somewhere here, so I supposed that '[' was the character needed to make it work... I'm afraid I didn't get it, sorry ![]() |
|
![]() |
![]() |
![]() |
#27 | |
Member
![]() Posts: 20
Karma: 10
Join Date: Apr 2012
Device: Kindle
|
Quote:
The Calibre bookshelf now shows 'series [0.10]' and the ebook in Kindle appears as before, with the title only. |
|
![]() |
![]() |
![]() |
#28 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,913
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
The simple template on: My Title in My Series[0] using Code:
{series}-{series_index:0>2s}-{title} My Series-00-My Title Start by removing the conditional stuff and start with a basic: Code:
{series}{series_index}-{title} Code:
{series}[{series_index}]-{title} |
|
![]() |
![]() |
![]() |
#29 |
Member
![]() Posts: 20
Karma: 10
Join Date: Apr 2012
Device: Kindle
|
Thank you, but if I apply the [0] index to any other title in my Calibre library that plugboard does the trick, so it seems the problem is with that specific title only... and I don't have the slightest idea why.
|
![]() |
![]() |
![]() |
#30 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,913
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
![]() You have a fake index (along with a real one) 'My series[2]' entered in the series field in the Metadata editor (there are 2 separate fields here. In Library view, the entry is parsed.) Creates: My series[2][1] The green, being the real index number |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
PRS-T1 How to sort series in order? | Lanix | Sony Reader | 10 | 02-20-2012 09:18 PM |
Sort books in series | whoadammit | Calibre | 2 | 02-16-2012 11:59 AM |
Sort collection by series number? | rp272 | Plugins | 2 | 08-05-2011 01:50 AM |
Quickest or best way to sort/edit metadata and series? | Goondu | Calibre | 2 | 01-14-2011 05:29 PM |
Is there a way to make a collection in the kindle sort by series #? | havenw | Amazon Kindle | 4 | 12-30-2010 03:44 PM |