View Single Post
Old 11-02-2022, 02:54 PM   #68
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,776
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by harmtemolder View Post
Come to think of it, I actually solved this same issue ages ago using a template function in calibre:

Code:
def evaluate(self, formatter, kwargs, mi, locals, progress_field):
  if progress_field:
    if float(progress_field.strip('%').strip()) < 100:
      return '☐'
    return '☑︎'
  return ''
Quote:
Originally Posted by harmtemolder View Post
I've replaced that old code with logic that looks at a book's highlights and sets a first read column to the earliest date, and a last read column to the latest. I hope that helps.
If you are running the newest version of calibre then the new Python templates might be of interest. Using these it isn't necessary to create user-defined template functions. See https://www.mobileread.com/forums/sh...53#post4264953 and the post immediately after it.
chaley is offline   Reply With Quote