07-04-2024, 04:02 PM | #1 |
Custom User Title
Posts: 9,535
Karma: 64960939
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
KoboTouch driver & SeriesID
On Kobo devices, the SeriesID field in the content table determines which books appears in each series. KoboTouch driver never seems to update the SeriesID once it's set, both sideloads and purchased books.
Sometimes series can get split apart due to differing SeriesIDs:
As per this thread, changing the SeriesID to all the same value (SQLite query) merges them together. I've not noticed any detrimental effects when tampering it manually, but sometimes after a sync it gets reset and splits apart again. Plus you have to do it every time you add a new book to the series. So, my thought: Could the KoboTouch driver be modified to set the SeriesID to the series name during automatic metadata management? Last edited by ownedbycats; 07-04-2024 at 11:59 PM. |
07-05-2024, 12:48 AM | #2 |
creator of calibre
Posts: 44,526
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I am not familiar with the kobo driver, so I could be wrong, but a quick inspection of the code indicates it does update the series, see line 3339 in kobo/driver.py and line 2650
|
Advert | |
|
07-05-2024, 01:02 AM | #3 |
Custom User Title
Posts: 9,535
Karma: 64960939
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
3339:
Code:
if series_changed or series_number_changed \ or not kobo_series_id == series_id \ or not kobo_series_number_float == newmi.series_index: update_values.append(series_id) set_clause.append('SeriesID') update_values.append(newmi.series_index) set_clause.append('SeriesNumberFloat') if show_debug: debug_print(f"KoboTouch:set_core_metadata Setting SeriesID - new_series='{new_series}', series_id='{series_id}'") |
07-05-2024, 01:17 AM | #4 |
Bibliophagist
Posts: 40,475
Karma: 156982136
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Rather odd. I just checked a series where I picked up the first book as a freebie, cleaned it up and edited it and then sent it to my Kobos. I liked the book so I picked up the next 3 books in the series from Kobo Plus. All four books show up with the same series name and the correct series number.
I checked all my Kobo and Kobo Plus books and none of them showed what looked like a GUID in the Series information. |
07-05-2024, 01:21 AM | #5 | |
Custom User Title
Posts: 9,535
Karma: 64960939
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Quote:
The only way to merge them together (without sideloading everything) is directly edit the database to set the SeriesID field of those books so they're all the same. KoboTouch doesn't change it once it's set, nor does Kobo Utilities. (And yes, I have it set to update purchased book.) Last edited by ownedbycats; 07-05-2024 at 01:29 AM. |
|
Advert | |
|
07-05-2024, 01:31 AM | #6 |
Bibliophagist
Posts: 40,475
Karma: 156982136
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Sorry but I edit my Kobo purchases so they are sideloaded with cleaned up metadata. I don't edit Kobo Plus books due my quasi-religious opinions about them not being my property. Though as near as I can tell, when I archive a book synced from Kobo, I no longer see it on my Kobo ereader and a sideloaded edited version is treated as a new book. I did some playing with this and I can change the series name and number in calibre and it will update the information for a purchased book if I have Update purchased books enabled and I have matched books between device and calibre.
Edit: I went back and looked at when I changed the series name for Mercedes Lackey's Valdemar series books to Valdemar : Subseries_name. Once I made those changes, I used KoboUtilies update metadata tool to update the metadata on the device and the series names changed (along with a couple of numbers that were incorrect to start with). Last edited by DNSB; 07-05-2024 at 01:42 AM. Reason: Added notes about changing series name in calibre |
07-05-2024, 02:41 AM | #7 |
Custom User Title
Posts: 9,535
Karma: 64960939
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
SeriesID doesn't affect that, it's behind-the-scenes and affects how the books group together on the Series page. Is possible to have books with same Series but different SeriesIDs. They'll show up as separate on the Kobo.
EDIT: Two recent acquisitions give an opportunity to demonstrate the accursed Pocket Books issue - 40 books I already set to the same SeriesID with the SQLite query, so they're a single series. But the two other books, which I haven't merged in yet, have it set to different values (GUIDs provided by the Kobo store). So they show up as two separate series of 1 book each, even with the same name. Last edited by ownedbycats; 07-05-2024 at 04:03 AM. |
07-05-2024, 07:21 AM | #8 |
Grand Sorcerer
Posts: 6,393
Karma: 12408443
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
Ok, now I get Series Id. I've got a specific query that remove all the seriesid associates only to one book, so I clean the series page.
|
07-05-2024, 08:04 AM | #9 |
Grand Sorcerer
Posts: 12,029
Karma: 7257323
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
To repeat what you said, the problem seems to be caused by having books that are both sideloaded and not. Looking at line 3330, the SeriesID is updated only if the book is sideloaded.
Code:
if self.supports_series_list and book.is_sideloaded: Code:
@property def is_sideloaded(self): # If we don't have a content Id, we don't know what type it is. return self.contentID and self.contentID.startswith("file") Does the problem fix itself if you send again from calibre the non-sideloaded books? It might not if the resend doesn't change enough to cause the book to be considered sideloaded (apparently where the book is stored). If resending the book does fix it then we have a no-risk solution. A possible fix would be to always update the series stuff, even for non-sideloaded books. I don't know why non-sideloaded books are excluded so I'm not willing to make this change without someone testing it. The change would be to (again) line 3300: Code:
if self.supports_series_list: |
07-05-2024, 09:00 AM | #10 |
Custom User Title
Posts: 9,535
Karma: 64960939
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Yes, sideloaded books set the SeriesID to the series name. But re-sending a store book to device just results in a duplicate book, lol.
I made the change to line 3300 and tested with a newly-purchased store book, unfortunately it doesn't seem to update. The SeriesID is still 7385b960-7cb7-5146-853b-968a87f2f8a0 rather than the series name. |
07-05-2024, 09:06 AM | #11 | |
Grand Sorcerer
Posts: 12,029
Karma: 7257323
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
if series_changed or series_number_changed or not book.is_sideloaded \ |
|
07-05-2024, 09:11 AM | #12 |
Grand Sorcerer
Posts: 12,029
Karma: 7257323
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Looking at the code, I think it is wrong. The block of code at line 3339 should be
Code:
if series_changed or series_number_changed \ or kobo_series_id != series_id \ or kobo_series_number_float != newmi.series_index: |
07-05-2024, 09:16 AM | #13 |
Custom User Title
Posts: 9,535
Karma: 64960939
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
I was curious about whether line 3340 could've had anything to do with it.
Alas, still no change to 7385b960-7cb7-5146-853b-968a87f2f8a0 |
07-05-2024, 09:18 AM | #14 |
Grand Sorcerer
Posts: 12,029
Karma: 7257323
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Did you also change line 3339, adding " or not book.is_sideloaded"?
|
07-05-2024, 09:29 AM | #15 |
Grand Sorcerer
Posts: 12,029
Karma: 7257323
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Try this for the code from lines 3330 to 3347. The change to line 3331 forces the series_id to the series name if the book is not sideloaded.
Code:
if self.supports_series_list: series_id = new_series if not book.is_sideloaded else self.kobo_series_dict.get(new_series, new_series) try: kobo_series_id = book.kobo_series_id kobo_series_number_float = book.kobo_series_number_float except Exception: # This should mean the book was sent to the device during the current session. kobo_series_id = None kobo_series_number_float = None if not book.is_sideloaded or series_changed or series_number_changed \ or kobo_series_id != series_id \ or kobo_series_number_float != newmi.series_index: update_values.append(series_id) set_clause.append('SeriesID') update_values.append(newmi.series_index) set_clause.append('SeriesNumberFloat') if show_debug: debug_print(f"KoboTouch:set_core_metadata Setting SeriesID - new_series='{new_series}', series_id='{series_id}'") |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Easiest method for bulk-setting SeriesID | ownedbycats | Kobo Reader | 25 | 06-27-2024 05:45 AM |
Bug with Subtitle in KoboTouch Driver 2.5.1 | JSWolf | Devices | 2 | 01-01-2021 10:35 AM |
[Device Plugin]KoboTouch driver for calibre 1.48 | davidfor | Plugins | 4 | 12-27-2015 07:03 AM |
USBNetwork USB Driver & Telnet on Windows XP SP3 | namati | Kindle Developer's Corner | 0 | 02-24-2012 02:20 AM |
PRS-500 driver & frimware | AVIV2007 | Sony Reader | 4 | 10-06-2011 03:57 PM |