|  06-02-2025, 01:26 PM | #346 | |
| Grand Sorcerer            Posts: 6,686 Karma: 12595249 Join Date: Jun 2009 Location: Madrid, Spain Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2 | Quote: 
  (I requested it). | |
|   |   | 
|  06-03-2025, 09:06 PM | #347 | |
| Zealot            Posts: 122 Karma: 10128 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. | |
|   |   | 
|  06-04-2025, 01:28 AM | #348 | |
| Grand Sorcerer            Posts: 6,686 Karma: 12595249 Join Date: Jun 2009 Location: Madrid, Spain Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2 | Quote: 
 | |
|   |   | 
|  06-04-2025, 02:41 AM | #349 | 
| Zealot            Posts: 122 Karma: 10128 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. | 
|   |   | 
|  06-04-2025, 06:05 AM | #350 | ||
| Grand Sorcerer            Posts: 12,525 Karma: 8065948 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. | ||
|   |   | 
|  06-04-2025, 04:40 PM | #351 | 
| Bibliophagist            Posts: 48,088 Karma: 174315300 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. | 
|   |   | 
|  06-05-2025, 01:07 AM | #352 | ||
| Zealot            Posts: 122 Karma: 10128 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. | ||
|   |   | 
|  06-05-2025, 02:26 AM | #353 | 
| Grand Sorcerer            Posts: 6,686 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).
		 | 
|   |   | 
|  06-05-2025, 07:28 AM | #354 | 
| Wizard            Posts: 1,026 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.
		 | 
|   |   | 
|  06-05-2025, 09:26 AM | #355 | 
| Custom User Title            Posts: 11,351 Karma: 79528341 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; 06-05-2025 at 11:30 AM. | 
|   |   | 
|  06-05-2025, 07:02 PM | #356 | 
| Bibliophagist            Posts: 48,088 Karma: 174315300 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.
		 | 
|   |   | 
|  06-06-2025, 05:08 AM | #357 | |
| Still reading            Posts: 14,986 Karma: 111111111 Join Date: Jun 2017 Location: Ireland Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper | Quote: 
 | |
|   |   | 
|  06-06-2025, 05:38 AM | #358 | |
| Grand Sorcerer            Posts: 12,525 Karma: 8065948 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. | |
|   |   | 
|  06-06-2025, 08:17 AM | #359 | 
| Custom User Title            Posts: 11,351 Karma: 79528341 Join Date: Oct 2018 Location: Canada Device: Kobo Libra H2O, formerly Aura HD | |
|   |   | 
|  06-06-2025, 01:21 PM | #360 | |
| Bibliophagist            Posts: 48,088 Karma: 174315300 Join Date: Jul 2010 Location: Vancouver Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos | Quote: 
 | |
|   |   | 
|  | 
| 
 | 
|  Similar Threads | ||||
| 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 |