Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 05-11-2023, 11:05 AM   #2626
isarl
Addict
isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.
 
Posts: 287
Karma: 2534928
Join Date: Nov 2022
Location: Canada
Device: Kobo Aura 2
Quote:
Originally Posted by decoherent View Post
Hi, I'm having some trouble getting the ToC updated on my Kobo Libra H2O. The plugin worked great to add the series metadata, so thanks for that Something about the ToC update process makes everything fall over, though. When the plugin finishes scanning through the books on my reader, it (correctly) notes that all of them need ToC updates. However, after running a few, I'll get the following error thrown:

Code:
calibre, version 6.17.0
ERROR: Unhandled exception: <b>TypeError</b>:tuple indices must be integers or slices, not str

calibre 6.17  embedded-python: True
Windows-10-10.0.19045-SP0 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.19045')
Python 3.10.1
Windows: ('10', '10.0.19045', 'SP0', 'Multiprocessor Free')
Interface language: None
Successfully initialized third party plugins: Kobo Utilities (2, 16, 6)
Traceback (most recent call last):
  File "calibre_plugins.koboutilities.action", line 5390, in update_book_toc_on_device
  File "calibre_plugins.koboutilities.action", line 5818, in update_device_toc_for_books
  File "calibre_plugins.koboutilities.action", line 5833, in update_device_toc_for_book
  File "calibre_plugins.koboutilities.action", line 5864, in getDatabaseChapterId
TypeError: tuple indices must be integers or slices, not str
After this, I have to close calibre and disconnect/reconnect my reader before it'll do anything useful again (it just promptly throws the error otherwise). I've tried using a smaller subset of books, maybe 10 to 50, but sometimes it'll, sometimes it'll crash.

I have no idea what this means, is there a suggested fix?
I encountered problems recently while updating TOCs, but not this specific problem. In my case the issue was that the plugin seemed to be using disk space and I was running out of it when trying to process my entire library at once. I switched to processing a few books at a time (even 1 book at a time, for the largest books) and it ran without issues. Dunno if this will help you, but I hope so. Good luck!
isarl is offline   Reply With Quote
Old 05-11-2023, 11:19 AM   #2627
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: 8,851
Karma: 62032373
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Quote:
Originally Posted by chaley View Post
No. The code was wrong. I don't see how it could have ever worked as it was unless the semantics of the python database calls changed.
What was wrong with it? I assume theres some specific circumstances that trigger it as I've been using update ToC for months and never come across any problems unless there's entries with duplicate names.
ownedbycats is online now   Reply With Quote
Advert
Old 05-11-2023, 11:22 AM   #2628
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,792
Karma: 7029971
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
What was wrong with it? I've been using update ToC for months and never come across any problems unless there's entries with duplicate names.
This line in this function:
Code:
    def getDatabaseChapterId(self, bookId, toc_file, connection):
        cursor = connection.cursor()
        t = ("{0}%{1}%".format(bookId,toc_file),)
        cursor.execute('select ContentID from Content where ContentID like ?', t)
        try:
            result = next(cursor)
            chapterContentId = result['ContentID'] # <==============
        except StopIteration:
            chapterContentId = None

        debug_print('getDatabaseChapterId - chapterContentId=%s' % chapterContentId)
        cursor.close()
        return chapterContentId
The connection was built without a row factory so using the row like a named tuple or a dict can't work. It must be subscripted like a normal tuple.

The fix is
Code:
    def getDatabaseChapterId(self, bookId, toc_file, connection):
        cursor = connection.cursor()
        t = ("{0}%{1}%".format(bookId,toc_file),)
        cursor.execute('select ContentID from Content where ContentID like ?', t)
        try:
            result = next(cursor)
            chapterContentId = result[0]  #<===============
        except StopIteration:
            chapterContentId = None

        debug_print('getDatabaseChapterId - chapterContentId=%s' % chapterContentId)
        cursor.close()
        return chapterContentId
chaley is offline   Reply With Quote
Old 05-11-2023, 01:45 PM   #2629
decoherent
Junior Member
decoherent began at the beginning.
 
Posts: 2
Karma: 10
Join Date: May 2023
Device: Kobo Libra H2O
Quote:
Originally Posted by chaley View Post
The attached beta version of the plugin *might* fix it. I don't use the plugin so I can't easily test it.
Well, I don't know what you fixed, but now it works perfectly, thanks!

Going back to my e-reader after using my tablet for a year or so has been annoying, as now I have to send the books, disconnect & let the device update, and then re-connect to send the series metadata and TOC, but, hey, whatever, at least it works! Thanks again!
decoherent is offline   Reply With Quote
Old 05-11-2023, 01:51 PM   #2630
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: 36,873
Karma: 147879470
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by decoherent View Post
Well, I don't know what you fixed, but now it works perfectly, thanks!

Going back to my e-reader after using my tablet for a year or so has been annoying, as now I have to send the books, disconnect & let the device update, and then re-connect to send the series metadata and TOC, but, hey, whatever, at least it works! Thanks again!
You should not need to reconnect to send the ToC. That should be extracted from the epub metadata when the books is imported. You will still need the second connect to send the series data, subtitles, page and word counts, etc.

Using the NickelSeries addon allows you to avoid the second connection to send series and subtitle but does not help with other metadata.
DNSB is offline   Reply With Quote
Advert
Old 05-11-2023, 02:15 PM   #2631
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: 8,851
Karma: 62032373
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Oh, NickelSeries also handles subtitle? I should look into it.
ownedbycats is online now   Reply With Quote
Old 05-11-2023, 02:15 PM   #2632
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,792
Karma: 7029971
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by chaley View Post
The attached beta version of the plugin *might* fix it. I don't use the plugin so I can't easily test it.
I have released this version.
chaley is offline   Reply With Quote
Old 05-11-2023, 03:45 PM   #2633
mbovenka
Wizard
mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.
 
Posts: 2,024
Karma: 13471689
Join Date: Oct 2007
Location: Almere, The Netherlands
Device: Kobo Sage
Quote:
Originally Posted by ownedbycats View Post
Oh, NickelSeries also handles subtitle? I should look into it.
Yes, it does.
mbovenka is offline   Reply With Quote
Old 07-01-2023, 04:31 PM   #2634
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,171
Karma: 4949904
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
I receive an error 403 which I reported in this thread... https://www.mobileread.com/forums/sh...21#post4336221

@DNSB believes it is a problem with the Kobo Utilities plugin

Attachment 202384
Karellen is online now   Reply With Quote
Old 07-01-2023, 10:18 PM   #2635
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: 8,851
Karma: 62032373
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
You can disable it here until somebody can get it fixed.
Attached Thumbnails
Click image for larger version

Name:	2023-07-01 23_16_58-Customize Kobo Utilities.png
Views:	84
Size:	28.5 KB
ID:	202395  
ownedbycats is online now   Reply With Quote
Old 07-01-2023, 11:00 PM   #2636
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: 36,873
Karma: 147879470
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Karellen View Post
I receive an error 403 which I reported in this thread... https://www.mobileread.com/forums/sh...21#post4336221

@DNSB believes it is a problem with the Kobo Utilities plugin
Basically, when I noticed the error, I tried a couple of firmware updates from KoboUtililities dropdown menu. This triggered the error each time. Since Kobo had mentioned making changes which would force using a 4.35+ firmware version to continue using their website, I felt it was a pretty safe bet that this change was triggering the issue with KoboUtilities.
DNSB is offline   Reply With Quote
Old 07-01-2023, 11:12 PM   #2637
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,171
Karma: 4949904
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
You can disable it here until somebody can get it fixed.
Great. Thanks

and Thanks @DNSB
Karellen is online now   Reply With Quote
Old 07-02-2023, 12:57 AM   #2638
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: 8,851
Karma: 62032373
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Line 164 of action.py:

Code:
KOBO_FIRMWARE_UPDATE_CHECK_URL = "https://api.kobobooks.com/1.0/UpgradeCheck/Device/{0}/{1}/{2}/{3}"
If I can find an updated URL, I will see if I can fix this.

EDIT: I posted in the Kobo forums about it.

Last edited by ownedbycats; 07-02-2023 at 01:10 AM.
ownedbycats is online now   Reply With Quote
Old 07-02-2023, 06:58 AM   #2639
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,669
Karma: 130140792
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
What URL does https://pgaskin.net/KoboStuff/kobofirmware.html use to deal with the firmware?
JSWolf is offline   Reply With Quote
Old 07-02-2023, 07:27 AM   #2640
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: 8,851
Karma: 62032373
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Looks to be this: https://github.com/pgaskin/kfwproxy

Quote:
Kobo API proxy for kobofirmware to enable cross-origin requests and caching. Each response is cached for 30 minutes to reduce the load on Kobo servers (otherwise there would be around half a million requests per day). In the future, kfwproxy will also support batched requests for better performance (currently, there are 112 requests per page load).
It might work. But I'm not too keen on using it without permission.
ownedbycats is online now   Reply With Quote
Reply

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

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 07:02 AM.


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