Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 09-15-2022, 02:42 AM   #61
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
Can you add support for the Device type "USER_DEFINED"? I added it as a compatible device type in the plugin I downloaded and it seems to work just fine, capable of finding the metadata and syncing to Calibre.
Thanks for your input. I've added it in release 0.3.1-beta: https://www.mobileread.com/forums/sh...41&postcount=1

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.
If this is a bug in KOReader I prefer to have it fixed at the source. Until then this issue is on the issue tracker, so if anyone feels like picking it up their help is greatly appreciated: https://todo.sr.ht/~harmtemolder/kor...libre-plugin/4
harmtemolder is offline   Reply With Quote
Old 09-16-2022, 02:16 AM   #62
harmtemolder
Enthusiast
harmtemolder began at the beginning.
 
Posts: 47
Karma: 10
Join Date: Oct 2020
Device: Kobo Aura
Quote:
Originally Posted by Huwaetzel View Post
The driver can be installed as a plugin and when the device is connected it gives a popup "Pocketbook632. Also in your plugin the error message states "type POCKETBOOK632 not yet supported.
I've added it in 0.3.2. Let me know if it works
harmtemolder is offline   Reply With Quote
Advert
Old 09-16-2022, 06:19 AM   #63
iupiter
Member
iupiter began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Sep 2022
Device: Pocketbook Inkpad Color
Quote:
Originally Posted by harmtemolder View Post
I've added it in 0.3.2. Let me know if it works
It works now.


What is the default state of the reading status, if an book never has been opened?
iupiter is offline   Reply With Quote
Old 09-20-2022, 04:11 PM   #64
Huwaetzel
Enthusiast
Huwaetzel began at the beginning.
 
Posts: 33
Karma: 10
Join Date: May 2011
Device: Pocketbook 903
Quote:
Originally Posted by iupiter View Post
It works now.
I can confrim this. Thank you very much for adding the device/driver
Huwaetzel is offline   Reply With Quote
Old 09-24-2022, 04:22 AM   #65
harmtemolder
Enthusiast
harmtemolder began at the beginning.
 
Posts: 47
Karma: 10
Join Date: Oct 2020
Device: Kobo Aura
Quote:
Originally Posted by iupiter View Post
What is the default state of the reading status, if an book never has been opened?
It will probably be empty: This plugin reads the contents of the meta lua file you can find next to the book on your ereader's memory, but KOReader only creates that file when you open a book.
harmtemolder is offline   Reply With Quote
Advert
Old 11-02-2022, 01: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
Old 11-02-2022, 01:13 PM   #67
harmtemolder
Enthusiast
harmtemolder began at the beginning.
 
Posts: 47
Karma: 10
Join Date: Oct 2020
Device: Kobo Aura
Quote:
Originally Posted by harmtemolder View Post
I've gone through my code from 2020 again, and it reads the date from `summary` > `modified` in the `metadata.epub.lua`. But I'm manually opening a couple from books that I've recently finished, and all of these have an empty string in that field. So it looks like KOReader no longer logs that in the metadata.
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.
harmtemolder is offline   Reply With Quote
Old 11-02-2022, 03: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: 12,027
Karma: 7257323
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
Old 11-06-2022, 03:13 AM   #69
Hyphen-ated
-
Hyphen-ated began at the beginning.
 
Posts: 46
Karma: 30
Join Date: Jan 2021
Device: Kobo Forma
Hi, I have implemented code in this plugin for a last_read_date column by reading the modify time of the metadata sidecar file and converting that to a date.

So now after I sync from my device, I can get calibre to sort my library by the last date I had each book open in koreader. Hooray!

My code is here: https://github.com/Hyphen-ated/korea...c94813a718df06
Hyphen-ated is offline   Reply With Quote
Old 11-08-2022, 02:55 PM   #70
harmtemolder
Enthusiast
harmtemolder began at the beginning.
 
Posts: 47
Karma: 10
Join Date: Oct 2020
Device: Kobo Aura
Quote:
Originally Posted by Hyphen-ated View Post
Hi, I have implemented code in this plugin for a last_read_date column by reading the modify time of the metadata sidecar file and converting that to a date.

So now after I sync from my device, I can get calibre to sort my library by the last date I had each book open in koreader. Hooray!
Great to hear you got this working for your device. It's probably a USB device connected as regular storage, isn't it?
harmtemolder is offline   Reply With Quote
Old 11-08-2022, 02:58 PM   #71
harmtemolder
Enthusiast
harmtemolder began at the beginning.
 
Posts: 47
Karma: 10
Join Date: Oct 2020
Device: Kobo Aura
On a different note: Someone reported that they got a ZoneInfoNotFoundError with v0.4.0-beta on Windows 10. Unfortunately I cannot test that, and they can't either. So if you have Windows 10 and run into the same issue, I'd be very grateful if you could test the otherwise untested v0.4.1-beta from here. If that solves it, I'll release it here.
harmtemolder is offline   Reply With Quote
Old 11-08-2022, 08:45 PM   #72
lightmaster
Member
lightmaster began at the beginning.
 
lightmaster's Avatar
 
Posts: 23
Karma: 10
Join Date: Aug 2022
Device: Kindle PW4 10th gen; Kobo Libra 2
Quote:
Originally Posted by harmtemolder View Post
On a different note: Someone reported that they got a ZoneInfoNotFoundError with v0.4.0-beta on Windows 10. Unfortunately I cannot test that, and they can't either. So if you have Windows 10 and run into the same issue, I'd be very grateful if you could test the otherwise untested v0.4.1-beta from here. If that solves it, I'll release it here.
I'm getting a "ZoneInfoNotFoundError: No time zone found with key UTC". Running Windows 11. About to download v0.4.1-beta to try it.
lightmaster is offline   Reply With Quote
Old 11-08-2022, 08:47 PM   #73
lightmaster
Member
lightmaster began at the beginning.
 
lightmaster's Avatar
 
Posts: 23
Karma: 10
Join Date: Aug 2022
Device: Kindle PW4 10th gen; Kobo Libra 2
Not getting the error anymore with v0.4.1-beta
lightmaster is offline   Reply With Quote
Old 11-08-2022, 09:03 PM   #74
Hyphen-ated
-
Hyphen-ated began at the beginning.
 
Posts: 46
Karma: 30
Join Date: Jan 2021
Device: Kobo Forma
Quote:
Originally Posted by harmtemolder View Post
Great to hear you got this working for your device. It's probably a USB device connected as regular storage, isn't it?
Yep, it is
Hyphen-ated is offline   Reply With Quote
Old 11-14-2022, 02:38 AM   #75
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
Not getting the error anymore with v0.4.1-beta
Assuming that everything else still works as expected I'll release it then. Thanks for testing!
harmtemolder is offline   Reply With Quote
Reply

Tags
calibre, koreader


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
What KOReader sync server? dmpop KOReader 4 04-28-2022 09:17 AM
Progress sync between koreader and ios Joretapo Kobo Reader 5 10-26-2020 08:21 PM
Running dropbox sync from within KOReader? ctop Kobo Developer's Corner 1 01-30-2020 12:33 PM
Koreader only for cloud sync LnZ KOReader 3 02-21-2019 08:09 AM
Koreader device plugin? richo Devices 3 08-07-2018 09:12 AM


All times are GMT -4. The time now is 07:54 PM.


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