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 03-20-2012, 11:10 PM   #16
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,842
Karma: 22666666
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 ~
kovidgoyal is online now   Reply With Quote
Old 03-21-2012, 07:45 AM   #17
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,733
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by kovidgoyal View Post
@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 ~
Hmmm... That would require recomputing the sort string for every compare. I might be able to cache the value, thus changing it to once every search, but that might not help. Get_categories could provide the values, but this would slow every call down for a rare benefit.

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?
chaley is offline   Reply With Quote
Advert
Old 03-21-2012, 08:40 AM   #18
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,842
Karma: 22666666
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
kovidgoyal is online now   Reply With Quote
Old 03-21-2012, 10:31 AM   #19
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,733
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Possible implementation pushed to launchpad. Discussion taken to email.
chaley is offline   Reply With Quote
Old 03-22-2012, 04:36 AM   #20
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,733
Karma: 6690881
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.
chaley is offline   Reply With Quote
Advert
Old 03-22-2012, 04:44 AM   #21
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,778
Karma: 54830978
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.
theducks is offline   Reply With Quote
Old 03-22-2012, 01:19 PM   #22
speakingtohe
Wizard
speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.
 
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. Above and beyond the call.

Thanks a lot.

Helen
speakingtohe is offline   Reply With Quote
Old 04-15-2012, 10:13 AM   #23
bob_bookworm
Member
bob_bookworm began at the beginning.
 
Posts: 19
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?
bob_bookworm is offline   Reply With Quote
Old 04-15-2012, 10:17 AM   #24
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383043
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.
HarryT is offline   Reply With Quote
Old 04-15-2012, 11:17 AM   #25
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,778
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by bob_bookworm View Post
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?
series_name[0] in the calibre bookshelf is correct In this view, they are (real) Numbers

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 try and substitute a non-special character
theducks is offline   Reply With Quote
Old 04-15-2012, 12:19 PM   #26
bob_bookworm
Member
bob_bookworm began at the beginning.
 
Posts: 19
Karma: 10
Join Date: Apr 2012
Device: Kindle
Quote:
Originally Posted by theducks View Post
...I wonder if the [ are causing problems try and substitute a non-special character
What '['s are you referring to? The ones in the plugboard?

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
bob_bookworm is offline   Reply With Quote
Old 04-15-2012, 12:25 PM   #27
bob_bookworm
Member
bob_bookworm began at the beginning.
 
Posts: 19
Karma: 10
Join Date: Apr 2012
Device: Kindle
Quote:
Originally Posted by HarryT View Post
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.
That didn't work, I'm afraid.
The Calibre bookshelf now shows 'series [0.10]' and the ebook in Kindle appears as before, with the title only.
bob_bookworm is offline   Reply With Quote
Old 04-15-2012, 01:05 PM   #28
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,778
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by bob_bookworm View Post
What '['s are you referring to? The ones in the plugboard?

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
Your (plugboard) template is trying to insert square brackets around the series_index

The simple template on: My Title in My Series[0] using
Code:
{series}-{series_index:0>2s}-{title}
results in
My Series-00-My Title


Start by removing the conditional stuff and start with a basic:
Code:
{series}{series_index}-{title}
then start adding the tricks until it breaks

Code:
{series}[{series_index}]-{title}
My Series[00]-My Title
theducks is offline   Reply With Quote
Old 04-15-2012, 02:19 PM   #29
bob_bookworm
Member
bob_bookworm began at the beginning.
 
Posts: 19
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.
bob_bookworm is offline   Reply With Quote
Old 04-15-2012, 03:35 PM   #30
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,778
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by bob_bookworm View Post
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.
Maybe

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
theducks is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 01:14 AM.


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