Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 06-02-2025, 10:44 AM   #1
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: 10,873
Karma: 74203799
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Kobo: Separate series index (text) and series_index (float)?

Suggestion: I wonder if these would be within scope to implement in Kobo Utilities:

Quote:
Originally Posted by ownedbycats View Post
On the Kobo device, the SeriesNumber row in the content table is a text column rather than an integer or float. Both null results and things like "1-4" are valid entries.

There's two things I'd like to know if are possible to do via plugboards:

1. For series omnibuses, I use series_indexes of x.y — 1.04 or 5.07. Is it possible to replace the period with a dash and remove the extra 0 to display as 1-4 on the Kobo?

2. For unnumbered series, I use a series_index of 0.0. This means a lot of "Series Name - 0"s on my device. Is it possible to return a null value instead?
Both of them can be done by editiing the SQLite database directly, but manually gets tiresome. If it's technically feasible, perhaps a KU menu option for selected books to run a SQLite query to overwrite, which is run prior to eject.
ownedbycats is offline   Reply With Quote
Old 06-02-2025, 01:26 PM   #2
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,618
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by ownedbycats View Post
Suggestion: I wonder if these would be within scope to implement in Kobo Utilities:



Both of them can be done by editiing the SQLite database directly, but manually gets tiresome. If it's technically feasible, perhaps a KU menu option for selected books to run a SQLite query to overwrite, which is run prior to eject.
I can tell you that run a sqlite query to overwrite the database is totally feasible, as I have exactly that, an action chain which run the query (as an option for Kobo Utilities) and Smart Eject after that. The issue is that I think it could be dangerous if you're not really, really aware of what you're doing. I know too that is only in my version because davidfor didn't want to include something like that (I requested it).
Terisa de morgan is offline   Reply With Quote
Advert
Old 06-03-2025, 09:06 PM   #3
Majutsushi
Connoisseur
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: 98
Karma: 8592
Join Date: Aug 2023
Location: New Zealand
Device: Kobo Clara HD, Kobo Libra Colour
Quote:
Originally Posted by ownedbycats View Post
Suggestion: I wonder if these would be within scope to implement in Kobo Utilities:

Both of them can be done by editiing the SQLite database directly, but manually gets tiresome. If it's technically feasible, perhaps a KU menu option for selected books to run a SQLite query to overwrite, which is run prior to eject.
That's an interesting idea, although I'm not sure how it could be implemented without either being too specific or effectively reinventing plugboards. Or do you mean actually allowing you to run an arbitrary SQL query? That would certainly be possible but also very dangerous like Terisa said. It would also have to be run in a similar manual way to what Terisa described since I don't think there's a way to hook into an eject event.

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.
Majutsushi is offline   Reply With Quote
Old 06-04-2025, 01:28 AM   #4
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,618
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by Majutsushi View Post
That's an interesting idea, although I'm not sure how it could be implemented without either being too specific or effectively reinventing plugboards. Or do you mean actually allowing you to run an arbitrary SQL query? That would certainly be possible but also very dangerous like Terisa said. It would also have to be run in a similar manual way to what Terisa described since I don't think there's a way to hook into an eject event.

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.
In my case, as it's a specific query, they query is built inside the code and there is a menu option to run it. So, it uses all the plugin mechanism to run it. It's not a "generic query builder" to run it, that I'm not sure how to implement it and, for sure, I wouldn't include as it's going to give more problems than adventages (that's my POV, of course).
Terisa de morgan is offline   Reply With Quote
Old 06-05-2025, 09:26 AM   #5
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: 10,873
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.
ownedbycats is offline   Reply With Quote
Advert
Old 06-05-2025, 07:02 PM   #6
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: 45,719
Karma: 168959600
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.
DNSB is offline   Reply With Quote
Old 06-06-2025, 05:38 AM   #7
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,399
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by DNSB View Post
And again, what effect would this change have on the SeriesNumberFloat field. Both fields are used internally by Kobo's firmware.
I'm curious; how do you know this? Is the firmware source available? What does the kobo use the float value for? My guess is sorting.

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.
chaley is offline   Reply With Quote
Old 06-06-2025, 03:24 PM   #8
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,618
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
In this message you can find some information about SeriesNumberFloat, that DNSB is talking about. Ah, and reading the thread, I see my query is doing what I wrote there: I keep Series and SeriesNumber, so the series is shown in the book in the library, but set to null (so not informed) SeriesId and SeriesNumberFloat, so Kobo doesn't count it to create series.

Last edited by Terisa de morgan; 06-06-2025 at 03:28 PM.
Terisa de morgan is offline   Reply With Quote
Old 06-06-2025, 03:24 PM   #9
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,618
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
In this message you can find some information about SeriesNumberFloat, that DNSB is talking about. Ah, and reading the thread, I see my query is doing what I wrote there: I keep Series and SeriesNumber, so the series is shown in the book in the library, but set to null (so not informed) SeriesId and SeriesNumberFloat, so Kobo doesn't count it to create series.
Terisa de morgan is offline   Reply With Quote
Old 06-12-2025, 11:53 AM   #10
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,399
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by chaley View Post
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.
I have an implementation of this that seems to work. I added a checkbox and template to the driver config metadata tab to set the series index (text) to whatever the template returns. I tested it with sideloaded books. I don't know what it will do with purchased/downloaded books.

My Libra 2 sorts on the series index (float). The series index (text) is ignored. I tested this by setting the text to (100-series_index).

If anyone wants to try it (no guarantees!) then run from source and put these two files in src/calibre/devices/kobo.
Attached Files
File Type: py kobotouch_config.py (53.9 KB, 5 views)
File Type: py driver.py (213.2 KB, 6 views)
chaley is offline   Reply With Quote
Old 06-12-2025, 12:28 PM   #11
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: 10,873
Karma: 74203799
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
I'll try it later. I connect my Kobo at end of day.
ownedbycats is offline   Reply With Quote
Old 06-12-2025, 09:14 PM   #12
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: 10,873
Karma: 74203799
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Code:
program: 
switch_if(
	$series_index ==#'0', '',
	$series_index
	)
Worked. Have not figure out how to turn 1.04 into 1-4 though.

Maybe this could be split into a thread for development subforum.
Attached Thumbnails
Click image for larger version

Name:	screen_001.png
Views:	27
Size:	342.9 KB
ID:	216193  

Last edited by ownedbycats; 06-12-2025 at 09:17 PM.
ownedbycats is offline   Reply With Quote
Old 06-13-2025, 06:04 AM   #13
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,399
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
Code:
program: 
switch_if(
	$series_index ==#'0', '',
	$series_index
	)
Worked. Have not figure out how to turn 1.04 into 1-4 though.
Assuming you use n.m only for omnibus-style books, multiple books in order, and not for intermediate books e.g. a book 2.5 that falls between 2 and 3, then this might work:
Code:
program:
	series_start = floor($series_index);
	fraction = fractional_part($series_index);
	if fraction ==# 0 then
		result = series_start
	else
		series_end = floor(fraction*100);
		if series_end >=# 0 then
			result = series_start & '-' & series_end
		fi
	fi;
	result
This template assumes you always use 2 digits in the fraction. How to disambiguate single digit fractions and 2 digit fractions isn't obvious.

Also, if you have both omnibus and intermediate books (as I do) then you would need some way to distinguish between them. I would use a Yes/No "Is Omnibus" column for this.

It might be easiest in the long run to have a text custom column that contains the series string you want for the book.

Quote:
Maybe this could be split into a thread for development subforum.
I put it in the devices forum.
chaley is offline   Reply With Quote
Old 06-13-2025, 06:36 AM   #14
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,399
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
I'll submit the changes to Kovid after I get more feedback.

If one doesn't use the feature then nothing changes in how the driver works.

Any risk arises if you use the feature and something in the Kobo or calibre doesn't like it. I think the risk is small because as far as I can tell the Kobo driver sets but never uses series_index (text).
chaley is offline   Reply With Quote
Old 06-13-2025, 08:39 AM   #15
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: 10,873
Karma: 74203799
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Quote:
Originally Posted by chaley View Post
Assuming you use n.m only for omnibus-style books, multiple books in order, and not for intermediate books e.g. a book 2.5 that falls between 2 and 3, then this might work:
Code:
program:
	series_start = floor($series_index);
	fraction = fractional_part($series_index);
	if fraction ==# 0 then
		result = series_start
	else
		series_end = floor(fraction*100);
		if series_end >=# 0 then
			result = series_start & '-' & series_end
		fi
	fi;
	result
This template assumes you always use 2 digits in the fraction. How to disambiguate single digit fractions and 2 digit fractions isn't obvious.

Also, if you have both omnibus and intermediate books (as I do) then you would need some way to distinguish between them. I would use a Yes/No "Is Omnibus" column for this.

It might be easiest in the long run to have a text custom column that contains the series string you want for the book.


I put it in the devices forum.
I have "omnibus" in the admintags column.
ownedbycats is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sage Add series / series index to Kobo baursak Kobo Reader 31 06-02-2024 09:37 PM
Searching on the highest series_index od series rolgiati Library Management 2 04-24-2023 02:24 PM
[Kobo] Series and series_index issue codychan Devices 11 04-06-2021 09:15 PM
Series Index displayed as separate column from Series Vortex Library Management 3 03-15-2015 08:39 PM
Need text box to float left beside image eggheadbooks1 ePub 35 06-06-2013 07:18 AM


All times are GMT -4. The time now is 01:08 PM.


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