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 04-12-2020, 03:08 PM   #16
Skydog
Wizard
Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.
 
Skydog's Avatar
 
Posts: 2,286
Karma: 7409537
Join Date: Mar 2009
Location: Circling Earth @ Mach .83
Device: Elipsa 2E, Sage, Libra Colour, Libra 2, Clara 2E, Oasis3, Voyage
Quote:
Originally Posted by davidfor View Post
One of the versions of code I posted should do what you want. You need to change the name of the column it uses to your column. That means changing where I have "timestamp" to "#finished". Then in the definition of the column, tick the "Show in Tag browser" option. That will show an entry for the new column with the count of books with a value in it. But, that number isn't the number of books that have a value in that column (and hence in #finished). It is the number of different values in the column. Clicking the heading in the tag browser will show the books with a value in it, and show the count of books in the status area at the bottom of the calibre window.
Thank you, davidfor. Even with your detailed explanation I failed. I copied/pasted your program, with changes, to the template field of the new composite column as shown below:

format_date(raw_field('#finished'),'MMM.yyyy')

Something is wrong since it created a new (Read) column and populated every line in my library with the the program as written above. Also, it wiped out all my existing "Finished" entries while recoloring all my books (instead of only those that have been finished, as I have customized). I deleted the attempted column and all has returned to normal.

The new "Read" column appeared in the tag browser but when clicked on, it displayed the program. BTW, what should be selected in the "Sort/Search column by" field? I had Date selected but it appears selecting other options had no effect.

Clearly, I am clueless.
Skydog is offline   Reply With Quote
Old 04-12-2020, 06:50 PM   #17
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,725
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Skydog View Post
Clearly, I am clueless.
Or maybe it's getting too complicated

I would add another column, something like this:

Click image for larger version

Name:	Annotation 2020-04-13 081502.jpg
Views:	72
Size:	44.0 KB
ID:	178338

And I would arrange the book list something like this

Click image for larger version

Name:	Annotation 2020-04-13 083458.jpg
Views:	75
Size:	178.5 KB
ID:	178339

The number of books for each Status (To Buy, Finished etc) are in the Tag browser

When I added a book I would press F2 on the Status cell and set it to Not Read, when I finished reading the book I would press F2 on the Status cell and set it to Abandoned, Finished or Read Again, tab into the Finished On cell, press '=' to get today's date then press Enter.

The Status cells will have a drop down list, if you choose the allowable values appropriately you can just press the first letter - a.g A for Abandoned, R for Read Again etc

BR
BetterRed is offline   Reply With Quote
Advert
Old 04-12-2020, 07:46 PM   #18
Skydog
Wizard
Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.
 
Skydog's Avatar
 
Posts: 2,286
Karma: 7409537
Join Date: Mar 2009
Location: Circling Earth @ Mach .83
Device: Elipsa 2E, Sage, Libra Colour, Libra 2, Clara 2E, Oasis3, Voyage
Quote:
Originally Posted by BetterRed View Post
Or maybe it's getting too complicated

BR
I believe you've hit the nail on the head.

Thank you, BetterRed, you've provided some interesting options to try - I will explore them further. Meanwhile, I am inclined to think that your first suggestion of a VL (which is now in use) is the best one for my single-purpose need. Simple, and even I was able to create one.

Many thanks for your assistance (and patience)!

Patricia
Skydog is offline   Reply With Quote
Old 04-13-2020, 12:56 AM   #19
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Skydog View Post
Thank you, davidfor. Even with your detailed explanation I failed. I copied/pasted your program, with changes, to the template field of the new composite column as shown below:

format_date(raw_field('#finished'),'MMM.yyyy')
You need "program:" in front of that. This tells calibre to use the "general program" mode for the template. It should be:

Code:
program:
format_date(raw_field('#finished'),'MMM.yyyy')
Though it can be on one line.

It could also be done as:

Code:
{#finished:format_date(yyyy.MM.dd)}
This is probably a faster when executing. I believe general program mode has some overhead when changing the template mode. I prefer the genera program mode as it tends to be easier to read for anything complicated. I frequently write in general program mode and then change it to one of the other modes when I have it worked out.
Quote:
Something is wrong since it created a new (Read) column and populated every line in my library with the the program as written above. Also, it wiped out all my existing "Finished" entries while recoloring all my books (instead of only those that have been finished, as I have customized). I deleted the attempted column and all has returned to normal.
That shouldn't happen. Adding a new column shouldn't change anything about the existing columns. The only thing I can think of is that you are using the View Manager plugin and this didn't handle adding the new column properly.
Quote:
The new "Read" column appeared in the tag browser but when clicked on, it displayed the program. BTW, what should be selected in the "Sort/Search column by" field? I had Date selected but it appears selecting other options had no effect.
That is because the template for the new column is wrong. When that is fixed, this will be as well.
davidfor is offline   Reply With Quote
Old 04-13-2020, 06:50 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: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by davidfor View Post
Code:
{#finished:format_date(yyyy.MM.dd)}
This is probably a faster when executing. I believe general program mode has some overhead when changing the template mode. I prefer the genera program mode as it tends to be easier to read for anything complicated. I frequently write in general program mode and then change it to one of the other modes when I have it worked out.
GPM should be faster than the other modes. GPM is easier to parse, the parse tree (the 'compiled code') is cached, and it avoids multiple calls to the template subsystem.

Last edited by PeterT; 04-13-2020 at 07:46 AM.
chaley is offline   Reply With Quote
Advert
Old 04-13-2020, 09:51 AM   #21
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by chaley View Post
GPM should be faster than the other modes. GPM is easier to parse, the parse tree (the 'compiled code') is cached, and it avoids multiple calls to the template subsystem.
Has that changed? I'm sure someone said it was slower. But, as I prefer GPM, that's good.

Maybe I am thinking of using template functions.
davidfor is offline   Reply With Quote
Old 04-13-2020, 11:59 AM   #22
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: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by davidfor View Post
Has that changed? I'm sure someone said it was slower. But, as I prefer GPM, that's good.
When I first implemented GPM I compiled the templates into python. That didn't work out when the formatter started being used in threads so I took it out. That could be the source of the thought that GPM is slower.

GPM will be slower for trivial templates such as "{authors}". It should be faster for things like "{authors:sublist(1,2,&)}". It will be faster for TPM templates like "{authors:'sublist($,1,2,'&')'}" because the quoted part is treated as a GPM template.
Quote:
Maybe I am thinking of using template functions.
Template functions are the fastest option, assuming that they do something more than return a metadata field. They are compiled into python executable code so the only overhead is looking up the function and passing the arguments.

Of course, the right way to answer the question is to time equivalent templates/programs, but I am too lazy.
chaley is offline   Reply With Quote
Old 04-13-2020, 06:16 PM   #23
Skydog
Wizard
Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.
 
Skydog's Avatar
 
Posts: 2,286
Karma: 7409537
Join Date: Mar 2009
Location: Circling Earth @ Mach .83
Device: Elipsa 2E, Sage, Libra Colour, Libra 2, Clara 2E, Oasis3, Voyage
@davidfor-

Success!... sort of.

With your first option (I tried both just for the exercise) I was ecstatic to see an entry and value appear on the tag browser. However, the value on the tag browser (223) does not match that in my library (250). The obvious conclusion would be that 27 of the "finished" books contain errors in the date formats, although dates are entered automatically, not manually. Unfortunately that is not the case.

I have checked and re-checked that the date formats are exactly the same for the new column and existing column. Also, I have displayed both columns side-by-side and inspected each of the 250 entries for any anomalies. Both the original "finished" column and the newly created column have identical number of entries, formatted dates and totals, just not in the tag browser. I also painstakingly inspected each "finished" book's metadata info just for comparison. It's all correct.

I never would have made it this far without your generous help. Realizing this is a different problem, are there other reasons why the tag browser is not reporting the correct value?

Many thanks!
Skydog is offline   Reply With Quote
Old 04-13-2020, 08:51 PM   #24
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by chaley View Post
When I first implemented GPM I compiled the templates into python. That didn't work out when the formatter started being used in threads so I took it out. That could be the source of the thought that GPM is slower.
That's probably it.
Quote:
GPM will be slower for trivial templates such as "{authors}". It should be faster for things like "{authors:sublist(1,2,&)}". It will be faster for TPM templates like "{authors:'sublist($,1,2,'&')'}" because the quoted part is treated as a GPM template.
And that is good to know as I have done the latter a few times in answering questions here.
Quote:
Template functions are the fastest option, assuming that they do something more than return a metadata field. They are compiled into python executable code so the only overhead is looking up the function and passing the arguments.
Even better. There is something about the template language that my brain doesn't like. Using Python for some things just seems easier.
Quote:
Of course, the right way to answer the question is to time equivalent templates/programs, but I am too lazy.
Me to. And, I know that if I started doing it, I'd suddenly realise that a couple of days had gone past without actually achieving anything useful.
davidfor is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Selection problem in the tag browser Danyx Calibre 2 01-22-2019 01:51 PM
Problem when using tag browser to rename series JohnnyBook Library Management 3 06-24-2018 04:22 PM
How to stop Tag Browser, Details and Cover Browser from showing on startup? stuartro Calibre 1 08-15-2016 11:53 PM
Problem with Tag Browser Custom Icon for Languages MartyTX Library Management 1 02-03-2013 03:44 AM
Problem with Topics Displayed in the Tag Browser of Various Libraries Lady Fitzgerald Library Management 5 03-01-2011 01:00 PM


All times are GMT -4. The time now is 03:17 AM.


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