Register Guidelines E-Books Today's Posts Search

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

Notices

Closed Thread
 
Thread Tools Search this Thread
Old 07-17-2023, 11:47 AM   #2716
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 11,015
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
currentchap/totalchap will only work for FanFicFare-downloaded stories. For regular books the file-structure varies too much to be reliably detectable with a regex.

Code:
program:

	input = $#kobobookmark;
# Don't change this to 'count' as that's a function
	ccount = $$#chaptercount;

	if 
## Checks that a Fanfiction has a Kobo bookmark and is not anthology|oneshot
## If you don't use a booktype-column, change this to check something else like a fandom column.
		$#booktype=='Fanfiction'
		&& 
		substr(input, 0, 10) == 'OEBPS/file'
		&& !$#fanficstatus in 'Anthology,Oneshot'
	then
## Extracts the 'current chapter' from the bookmarks, subtracts 1, and then formats them as 'currentchap/totalchap'
		strcat(format_number(re(input, '.*\/file(\d+).*', '\1') - 1, '{0:,d}'), '/',ccount)

## This will display the regular chapter-count for everything else.
	else
		ccount
	fi
ownedbycats is offline  
Old 07-17-2023, 12:01 PM   #2717
BookJunkieLI
Evangelist
BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.
 
BookJunkieLI's Avatar
 
Posts: 435
Karma: 572984
Join Date: Jan 2010
Location: Long Island
Device: Kobo Libra 2, Kindle 4, Nook Gl4, Nook STR, REB 1100, Ebookwise 1500,
Quote:
Originally Posted by ownedbycats View Post
currentchap/totalchap will only work for FanFicFare-downloaded stories. For regular books the file-structure varies too much to be reliably detectable with a regex.

Code:
program:

	input = $#kobobookmark;
# Don't change this to 'count' as that's a function
	ccount = $$#chaptercount;

	if 
## Checks that a Fanfiction has a Kobo bookmark and is not anthology|oneshot
## If you don't use a booktype-column, change this to check something else like a fandom column.
		$#booktype=='Fanfiction'
		&& 
		substr(input, 0, 10) == 'OEBPS/file'
		&& !$#fanficstatus in 'Anthology,Oneshot'
	then
## Extracts the 'current chapter' from the bookmarks, subtracts 1, and then formats them as 'currentchap/totalchap'
		strcat(format_number(re(input, '.*\/file(\d+).*', '\1') - 1, '{0:,d}'), '/',ccount)

## This will display the regular chapter-count for everything else.
	else
		ccount
	fi
Cool. For input = $#kobobookmark; would I use #kobostatus since that's where I'm currently putting the location information?
Although I may change the column name since Status, to me, indicates Unread, Reading, Finished.

And for $#booktype=='Fanfiction' I have a column called #library that is 'Text, but with a set of permitted values' wherein the values are Fanfic, Fiction, Non-Fiction. Would that work?
BookJunkieLI is offline  
Advert
Old 07-17-2023, 12:05 PM   #2718
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 11,015
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Quote:
Originally Posted by BookJunkieLI View Post
Cool. For input = $#kobobookmark; would I use #kobostatus since that's where I'm currently putting the location information?
Although I may change the column name since Status, to me, indicates Unread, Reading, Finished.

And for $#booktype=='Fanfiction' I have a column called #library that is 'Text, but with a set of permitted values' wherein the values are Fanfic, Fiction, Non-Fiction. Would that work?
#kobobookmark is whatever column contains the filename stuff.

#library=='Fanfic' should work, yes. My #booktype is the same column type (enumerated).

You can safely remove the fanficstatus line, but this will result in the template showing the wrong result for FFF anthologies.
ownedbycats is offline  
Old 07-17-2023, 12:22 PM   #2719
BookJunkieLI
Evangelist
BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.
 
BookJunkieLI's Avatar
 
Posts: 435
Karma: 572984
Join Date: Jan 2010
Location: Long Island
Device: Kobo Libra 2, Kindle 4, Nook Gl4, Nook STR, REB 1100, Ebookwise 1500,
I think I have one anthology so it shouldn't be an issue.

Works great. Although I apparently have some fics I know I downloaded with FFF that don't have chapter counts. Oh well, fixing metadata is never done. LOL

Thanks for all the help.
BookJunkieLI is offline  
Old 07-20-2023, 09:19 AM   #2720
ksignorini
Junior Member
ksignorini began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jul 2023
Device: Kobo Clara 2E
I'm having trouble getting annotations to download from the Kobo to Calibre. When downloading the annotations file, it shows blank, and when only downloading a single book's annotations, nothing shows up.

However, when using the Annotations plugin (not Kobo Utilities) it works just fine and annotations are downloaded from the reader to Calibre.

Is there some kind of configuration that needs to be done? Is this a known bug with a path to resolution?

Thanks!

(Oh, and I'm using KoboExtended KePubs converted from mobi.)

Last edited by ksignorini; 07-20-2023 at 09:21 AM. Reason: clarification
ksignorini is offline  
Advert
Old 07-20-2023, 09:53 AM   #2721
Quoth
Still reading
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 14,160
Karma: 105212035
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
Using Kobo Utilities you select an ebook when Kobo connected and select Copy Annotation and it opens a window. You then copy/paste to a text editor (Notepad++ in Windows or WINE, KATE or similar in Linux), and then you can save a file.
The Annotations plugin copies the annotation into Calibre's book record.
I've used the Kobo Utilities method maybe over 1000 times with no issue except once when Kobo database was corrupt. The Kobo Utilities method by default doesn't directly create a file or add the data to Calibre.
Quoth is offline  
Old 07-21-2023, 01:22 PM   #2722
ksignorini
Junior Member
ksignorini began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jul 2023
Device: Kobo Clara 2E
Quote:
Originally Posted by Quoth View Post
Using Kobo Utilities you select an ebook when Kobo connected and select Copy Annotation and it opens a window. You then copy/paste to a text editor (Notepad++ in Windows or WINE, KATE or similar in Linux), and then you can save a file.
The Annotations plugin copies the annotation into Calibre's book record.
I've used the Kobo Utilities method maybe over 1000 times with no issue except once when Kobo database was corrupt. The Kobo Utilities method by default doesn't directly create a file or add the data to Calibre.
But when I do that, I get an empty dialog box. There is nothing to copy.

If I use the Annotations plug-in on the same book, I can see it has annotations and get them imported into Calibre.
ksignorini is offline  
Old 08-03-2023, 08:25 AM   #2723
HydroGuy
Junior Member
HydroGuy began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Aug 2023
Device: Kobo Touch
403 error updating

getting a similiar 403 error referenced a few pages back with a Kobo touch. Calibre 6.23.0 and kobo plugin 2.16.10. Correctly sees the available update but fails on update.
calibre, version 6.23.0 (win32, embedded-python: True)
Failed to update Kobo firmware: Failed: Downloading Kobo firmware update

HTTP Error 403: Forbidden

Traceback (most recent call last):
File "calibre\gui2\device.py", line 104, in run
File "calibre_plugins.koboutilities.jobs", line 123, in do_check_firmware_update
File "urllib\request.py", line 216, in urlopen
File "urllib\request.py", line 525, in open
File "urllib\request.py", line 634, in http_response
File "urllib\request.py", line 563, in error
File "urllib\request.py", line 496, in _call_chain
File "urllib\request.py", line 643, in http_error_default
urllib.error.HTTPError: HTTP Error 403: Forbidden
HydroGuy is offline  
Old 08-07-2023, 08:00 PM   #2724
bookloverCA
Member
bookloverCA began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Aug 2023
Device: Kobo Libra 2
I recently purchased a Libra 2. I am very glad to find this plug-in. It works quite well. Thanks a lot. I encounter several issues about annotation export. I hope you can help me.

1. Unable to copy/backup annotation for books not sideloaded from Calibre or purchased books:
"Copy Annotations for selected books" and "Back up annotation file" don't show up on "Device" view for any books including books sideloaded from Calibre. The only option I have is "Remove annotation file". Those two options show up on "Calibre Library" view.

Since books sideloaded by other means and purchased books are not on "Calibre Library" view, I cannot export annotations.

2. "Copy annotation file" doesn't work
After I selected a folder and clicked OK, I didn't see any file being saved. Here is the dialog after I clicked OK.

3. The annotation seems to get the "chapter" numbers wrong. It seems that it counts entries in the TOC after "cover" as chapter numbers. For example, in the screenshot below, "Introduction" is as "Chapter 6", and "The Limits of Consciousness" as "Chapter 13". They are actually under chapters 1 and 2 in the TOC. There are 7 (13-6) entries (sub-chapters) in the TOC between those two highlights.

Thanks again for your help.
Attached Thumbnails
Click image for larger version

Name:	Capture.JPG
Views:	977
Size:	22.0 KB
ID:	203033   Click image for larger version

Name:	Capture1.JPG
Views:	977
Size:	113.9 KB
ID:	203034  
bookloverCA is offline  
Old 08-10-2023, 03:21 AM   #2725
Majutsushi
Zealot
Majutsushi shines like a glazed doughnut.Majutsushi shines like a glazed doughnut.Majutsushi shines like a glazed doughnut.Majutsushi shines like a glazed doughnut.Majutsushi shines like a glazed doughnut.Majutsushi shines like a glazed doughnut.Majutsushi shines like a glazed doughnut.Majutsushi shines like a glazed doughnut.Majutsushi shines like a glazed doughnut.Majutsushi shines like a glazed doughnut.Majutsushi shines like a glazed doughnut.
 
Posts: 100
Karma: 8592
Join Date: Aug 2023
Location: New Zealand
Device: Kobo Clara HD, Kobo Libra Colour
I'm getting this exception when syncing reading positions:

Code:
calibre, version 6.24.0 (linux, embedded-python: False)
Failed to get reading positions: Failed: Storing reading positions for 1330 books

[Errno 11] write could not complete without blocking

Traceback (most recent call last):
  File "/usr/lib/calibre/calibre/gui2/device.py", line 104, in run
    self.result = self.func(*self.args, **self.kwargs)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "calibre_plugins.koboutilities.jobs", line 355, in do_store_locations
    debug_print(job.details)
  File "calibre_plugins.koboutilities.jobs", line 44, in debug_print
    prints('DEBUG: %6.1f'%(time.time()-BASE_TIME), *args)
  File "/usr/lib/calibre/calibre/prints.py", line 39, in prints
    stream.write(x)
BlockingIOError: [Errno 11] write could not complete without blocking
This is caused by excessive debug output overwhelming the output buffer. Setting "JOBS_DEBUG = False" in "jobs.py" works around it. It's probably not a good idea to enable debug logging by default anyway, especially since it's cluttering my log files.
Majutsushi is offline  
Old 08-10-2023, 01:08 PM   #2726
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,417
Karma: 169098492
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Majutsushi View Post
This is caused by excessive debug output overwhelming the output buffer. Setting "JOBS_DEBUG = False" in "jobs.py" works around it. It's probably not a good idea to enable debug logging by default anyway, especially since it's cluttering my log files.
I'd tend to suspect that @chaley enabled debug logging while working on the plugin and forget to turn it off for the release version. It's happened before, often when the person working on the plugin was not the original author and will likely happen again.
DNSB is offline  
Old 08-10-2023, 01:48 PM   #2727
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,449
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by DNSB View Post
I'd tend to suspect that @chaley enabled debug logging while working on the plugin and forget to turn it off for the release version. It's happened before, often when the person working on the plugin was not the original author and will likely happen again.
Wasn't me. @davidfor tended to leave debugging on, depending on calibre usually running without debugging to avoid the output problems. I understand the position, because without it debugging user reported problems is very hard.
chaley is offline  
Old 08-10-2023, 01:52 PM   #2728
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,417
Karma: 169098492
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by chaley View Post
Wasn't me. @davidfor tended to leave debugging on, depending on calibre usually running without debugging to avoid the output problems. I understand the position, because without it debugging user reported problems is very hard.
I remember that. On one occasion during one of the Kobo betas, it caused some rather massive logs.
DNSB is offline  
Old 08-11-2023, 03:28 AM   #2729
Majutsushi
Zealot
Majutsushi shines like a glazed doughnut.Majutsushi shines like a glazed doughnut.Majutsushi shines like a glazed doughnut.Majutsushi shines like a glazed doughnut.Majutsushi shines like a glazed doughnut.Majutsushi shines like a glazed doughnut.Majutsushi shines like a glazed doughnut.Majutsushi shines like a glazed doughnut.Majutsushi shines like a glazed doughnut.Majutsushi shines like a glazed doughnut.Majutsushi shines like a glazed doughnut.
 
Posts: 100
Karma: 8592
Join Date: Aug 2023
Location: New Zealand
Device: Kobo Clara HD, Kobo Libra Colour
Quote:
Originally Posted by DNSB View Post
I remember that. On one occasion during one of the Kobo betas, it caused some rather massive logs.
Yeah, it's certainly pretty verbose, hence this issue. I noticed that the plugin also imports a "DEBUG" variable from "calibre.constants", although I'm not sure where you would set that. Maybe the plugin should have an "enable debug logging" option rather than always enabling it. There should also be a way to log in a way to doesn't cause this issue. I just hope that I won't have to manually edit the plugin after every update.
Majutsushi is offline  
Old 08-11-2023, 04:26 AM   #2730
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,382
Karma: 27756918
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That error indicates STDOUT in whatever environment you are running calibre in is non-blocking. This is not normal. Find out why that is and fix it and you will be fine. Or redirect STDOUT and STDERR to /dev/null when launching calibre.
kovidgoyal is online now  
Closed Thread

Tags
calibre, kobo, kobo utilities, kobo-utilities, plugins


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Manga plugin mastertea Plugins 6 01-06-2022 02:43 AM
[GUI Plugin] Save Virtual Libraries To Column (GUI) chaley Plugins 14 04-04-2021 05:25 AM
Kobo Utilities Plugin Question nikev Kobo Reader 10 09-25-2018 11:55 PM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 12:27 PM


All times are GMT -4. The time now is 11:50 PM.


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