View Single Post
Old 11-02-2022, 12:08 PM   #66
harmtemolder
Enthusiast
harmtemolder began at the beginning.
 
Posts: 47
Karma: 10
Join Date: Oct 2020
Device: Kobo Aura
Quote:
Originally Posted by lightmaster View Post
On a different note, it seems that while Koreader sets the "Summary"=>"Status" metadata when you finish a book, it does not set any status metadata for when you have a book that is currently being read. I thought that something like this might work, but my very rudimentary knowledge of python prevents me from trying it myself: "if 'Summary'=>'Status' doesn't exist, and read progress is >0 and <1, then set 'Summary'=>'Status' to 'in-progress'". This logic would also mean that if Koreader does start setting an in-progress metadata, this plugin won't override it.
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 ''
harmtemolder is offline   Reply With Quote