![]() |
#346 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,607
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#347 | |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 97
Karma: 8592
Join Date: Aug 2023
Location: New Zealand
Device: Kobo Clara HD, Kobo Libra Colour
|
Quote:
I'm curious how it's implemented in the version that Terisa uses, particularly how you can run predefined queries in an automated fashion. I can create an issue for it, but I can't promise anything especially since I'm currently in the middle of some big internal refactorings. |
|
![]() |
![]() |
Advert | |
|
![]() |
#348 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,607
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
Quote:
|
|
![]() |
![]() |
![]() |
#349 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 97
Karma: 8592
Join Date: Aug 2023
Location: New Zealand
Device: Kobo Clara HD, Kobo Libra Colour
|
I just had an idea: since you can write custom modules for the ActionChains plugin in Python, it should be possible to write a module that calls into the KoboUtilities plugin so that it gives you a database connection, and then the module can use that connection to run any query it wants. Currently the relevant method would be "calibre_plugins.koboutilities.action.KoboUtilitie sAction.device_database_connection()". You need the running instance of that action though, and I'm not sure how to get access to that from a module. That's a question for people who are more familiar with that plugin.
Note that the above method will probably move and/or change a bit as part of my current refactoring, but there should still be a way to access it once I'm done. |
![]() |
![]() |
![]() |
#350 | ||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,362
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Quote:
I strongly advise you not to pass around database connections. There are all sorts of ways where these can lead to disaster, for example when threading. It would also permit a user to rather easily trash the database. |
||
![]() |
![]() |
Advert | |
|
![]() |
#351 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,286
Karma: 168808723
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
A couple of issues that I see with the suggested change. One being that I have quite a few series indexes such as 1.25, 1.33 or 1.50 where there is one or more novella/short story/whatevers that are part of the series but is not part of the mainline. Another potential issue is that there are more than one location for the SeriesNumber, there is a SeriesNumber field that is a text field but there is also a SeriesNumberFloat field that is defined as Real. Another potential issue being that when I import a book from my Kobo ereaders to calibre, the series index code would be need to be able to handle either case and convert back to the x.yy format unless Kovid is willing to change the series index code in calibre to handle either case. I suspect that the majority of the changes are going to need to be implemented in the KoboTouch driver.
I do have a couple of items that are done by directly accessing the Kobo database but nothing that I would consider as being safe enough for general distribution. They are definitely backup the database, perform the action and check that the database is still valid before continuing. At least twice, they were broken by updates to the Kobo database. |
![]() |
![]() |
![]() |
#352 | ||
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 97
Karma: 8592
Join Date: Aug 2023
Location: New Zealand
Device: Kobo Clara HD, Kobo Libra Colour
|
Quote:
Quote:
As for safety of the connection, if you use the returned connection object as a context manager then it takes a lock and creates a transaction, so it should be safe from that standpoint. I actually suggested the lock feature to Kovid because it was necessary for safely handling the case in Calibre 8 where the database might have been copied to a different location due to filesystem limitations. So this idea wasn't about creating some official API, just something that people who know what they're doing might use for things that aren't available in the plugin. |
||
![]() |
![]() |
![]() |
#353 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,607
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
The part about "who know what they are doing" when you're creating something that everybody can use is complicated. Even creating an action chain means that you know how to handle some aspects that you can copy/paste, but have no idea of what you're really doing (I say it through my own experience).
|
![]() |
![]() |
![]() |
#354 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,009
Karma: 500000
Join Date: Jun 2015
Device: Rocketbook, kobo aura h2o, kobo forma, kobo libra color
|
Agree. This would be really complicated and possibly dangerous to implement with a database edit, but would be less than a line to do just by filling in the right stuff in the existing plugboard.
|
![]() |
![]() |
![]() |
#355 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,788
Karma: 74203799
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
I will open a ticket and see what Kovid thinks.
EDIT: https://bugs.launchpad.net/calibre/+bug/2112564 EDIT: wontfix. Last edited by ownedbycats; Yesterday at 11:30 AM. |
![]() |
![]() |
![]() |
#356 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,286
Karma: 168808723
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
And again, what effect would this change have on the SeriesNumberFloat field. Both fields are used internally by Kobo's firmware.
|
![]() |
![]() |
![]() |
#357 | |
Still reading
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,810
Karma: 103895653
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
|
Quote:
|
|
![]() |
![]() |
![]() |
#358 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,362
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
I'm tempted to add setting the text index using a template to the driver just to see what happens. I think the driver doesn't read/use that field (not near my computer so can't check). The change would be easier than it was to add collection management via template. |
|
![]() |
![]() |
![]() |
#359 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,788
Karma: 74203799
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
|
![]() |
![]() |
![]() |
#360 | |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,286
Karma: 168808723
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[GUI Plugin] Kobo Utilities | davidfor | Plugins | 3216 | 02-08-2025 04:23 AM |
[GUI Plugin] Noosfere_util, a companion plugin to noosfere DB | lrpirlet | Plugins | 2 | 08-18-2022 03:15 PM |
[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 |