View Single Post
Old 11-23-2021, 09:39 PM   #2344
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
It really depends on what the purpose of these columns are. I think that your current "Finished" column is a manual copy of what is in the "Kobo Last Read TimeStamp" column and which was retrieved from the device. If that is the case, then replacing the "Finished" column with the column with the template is what I would do. This is basically what I do. While all the columns have "kobo" in the name, if I read something elsewhere, I manually fill in the columns. And I might push the status to the ereader.

If the current "Finished" column also has timestamps that came from other reading methods, then you need to decide if you want to keep that separate from the Kobo timestamp. If you don't, then I would copy the values in "Finished" column to the Kobo timestamp column. Then I would replace the "Finished" column with the template column.

If you do want to keep these separate, then we could come up with a template that showed one of the timestamps. Exactly what that would be depends on what the expected combinations of values are and which takes preference. For example:

Code:
program:
kobo_date = cmp($$#kobo_percent_read, 100, '', $$#kobo_last_read, $$#kobo_last_read);
cmp(days_between($$#finished, kobo_date), 0, format_date(kobo_date,'dd MMM yyyy'), format_date($$#finished,'dd MMM yyyy'), format_date($$#finished,'dd MMM yyyy'));
That would use the latest of either of the two dates and only use the Kobo timestamp if the book is finished.
My apologies for the confusion. I only wish to have one "Finished" column that displays the date when the book is finished (100%).

I tried replacing the code with what you provided in your first reply and it deleted all the previously existing dates (a result of a convoluted method I was using). Then I tried the code above and it placed an entry in every book in my library with BAD DATE. I stumbled upon the template editor and a few things were highlighted in blue, if that means anything. (see screenshot).

To keep it simple, all I am trying to create is one column, with a single entry of dd MMM yyyy when a book is finished and I connect a device to Calibre.

The first three fields are:

Lookup name: finished
Column heading: Finished
Column type: Column built from other columns

Thank you for your assistance. So close, but not quite there.
Attached Thumbnails
Click image for larger version

Name:	Screenshot (7).png
Views:	1663
Size:	79.0 KB
ID:	190401  

Last edited by Skydog; 11-23-2021 at 11:49 PM. Reason: Corrections and attachment
Skydog is offline