02-28-2022, 12:37 PM | #1 |
Grand Sorcerer
Posts: 11,789
Karma: 7029971
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
New Kobo Libra 2 -- setup questions
My old Boox reader died and I decided to try a Kobo Libra 2. So far so good.
Two questions:
EDIT: Is there any big downside to not entering my Kobo account into the reader other than not being able to buy books from the reader itself? EDIT 2: Is there a way to give a different device name in the Kobo Utilities plugin devices tab? If this goes well then my wife will also get the same reader and it would be nice to tell them apart other than with the serial number. Last edited by chaley; 02-28-2022 at 12:47 PM. |
02-28-2022, 01:52 PM | #2 |
Well trained by Cats
Posts: 29,981
Karma: 56143930
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
I just edited the json value 'name' (inserted a V
It did not seem to barf. BTW Utilities does show Serial number I also have my devices configured to use different Backup-database folders |
Advert | |
|
02-28-2022, 02:00 PM | #3 | |
Grand Sorcerer
Posts: 11,789
Karma: 7029971
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Now I am fighting with "Database is locked." EDIT: this seems to be my fault. The kobo desktop was running. I killed it, ejected, reconnected, ran chkdsk (as it wanted) and now it works. Last edited by chaley; 02-28-2022 at 02:37 PM. |
|
02-28-2022, 03:59 PM | #4 |
Well trained by Cats
Posts: 29,981
Karma: 56143930
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
It is in Kobo Utilities.json (plugin folder)
Maybe you have to Configure options for each device ticked |
02-28-2022, 09:37 PM | #5 | ||||
Grand Sorcerer
Posts: 24,906
Karma: 47303822
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
Code:
program: raw_list('authors', ', ') Quote:
Quote:
Quote:
And I wonder if it would be safe for the plugin to set the name used by the driver. I'll have to experiment. |
||||
Advert | |
|
03-01-2022, 07:04 AM | #6 | ||
Grand Sorcerer
Posts: 11,789
Karma: 7029971
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Thanks for the "kobo newbie" help.
Quote:
Code:
program: a = list_re_group($authors, '&', '.', '(^.*$)', 'program: swap_around_comma($)'); re(a, '&', ', ') Quote:
Using a template and setting the device name (below) solves another problem, using different collection columns for different devices. The template could condition its output on the value of current_device_name(). |
||
03-01-2022, 10:19 AM | #7 |
Grand Sorcerer
Posts: 11,789
Karma: 7029971
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
I looked at the code for the driver and the utilities and I think that setting the device name will be a giant pain in the *^&. The problem is the sequencing of the operations. The calibre device driver gets and caches the device_info before the utilities can get involved.
I also looked at the code for generating collection values (get_collections). Changing that to use a template will also be a pain because so much of it is built around lookup/collection names. Fortunately for me, neither of the above is needed. The following solves my problem albeit with a bit of brute force:
|
03-02-2022, 04:46 AM | #8 |
Grand Sorcerer
Posts: 24,906
Karma: 47303822
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Firstly, looking at the code for the collections, I remember how much I hated it. And, honestly, I didn't understand enough about calibre at the time to do it properly. Plus, it was pretty much my first time coding Python. I think that's why I dropped the SONY options as it was doing my head in at the time. But, looking at it, and the version of "get_collections" in CollectionsBookList, I do not think that it would be that hard to put it back in.
But, I think I'd prefer to add template support. Can you post the template you are using? Your code isn't what I was thinking of. I think your intention is to use both the collection column list and a template. And the template is applied to the values from the collection columns. When I thought of this, my intention was use the template to return a list of collection names. And they would be used without any further changes. Which explains why you were adding a field in the config. After yesterday's posts, I was thinking of adding a "Use template" checkbox. When selected the current collection columns field would be replaces by the TemplateConfig widget that is in the configuration code. That is the field plus template editor button and validation. That would be safer than parsing for whether it was a template or not. I'll add the serial number. The driver is already reading the version file, so it should be getting the serial number. I didn't mention it yesterday, but, someone asked something similar to this recently. For that, I suggested using the template function "connected_device_uuid". That can be gotten from the driveinfo.calibre file and is how both the Kobo Utilities and Reading List plugins identify a device. Passing that and possibly the firmware version in might be useful. |
03-02-2022, 07:26 AM | #9 | ||||||
Grand Sorcerer
Posts: 11,789
Karma: 7029971
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
I started using calibre when I bought my first Sony PRS 350 in 2010 (IIRC). I wanted better collections support, specifically collections from calibre fields. I opened the idea with Kovid and he said "Go ahead. No promise I will take it though." Given that it was my first foray into python and calibre code, his position was wise. It is also worth noting that this effort precedes my custom column work by a couple of years. So, as is usual in these cases I built what I wanted: automatic collections management. By this time Kovid and I decided we worked well enough together and he gave me (more-or-less) free rein. I released it, and oh my did the excrement hit the rotating blades. There were four general responses:
The Sony shows collection entries in the order they were added, which by the way I really wish I could do on a Kobo. This permitted me to control the display order of collections, in particular the series collection. It also explains why the collection code passes around sort values. Around this time (2012?) we started working on custom columns, which expanded the universe of collections possible to create. Some issues:
Quote:
Quote:
The technique I used avoids this problem by leaving all the metadata management and device collections stuff as it is. Instead, when collection names are being generated from columns I can remove or rename them. The template below shows what I mean. I have (actually, will have) two libra 2 readers, mine and my wife's. For mine I want the following collections:
The "Collection columns" box contains all the columns we both want to use: "#dthtags, authors, #cbhtags". The template cleans things up using the device serial number to select what to do. For columns not wanted on the device it returns '', removing that collection value. It does this by checking the lookup_name and the serial number.
Code:
program: globals(val='Last, First', lookup_name='authors', serial_number='N4181B5019336', heading='Authors'); if serial_number == 'N4181B5019336' then if lookup_name == 'authors' then return strcat(heading, ': ', substr(val, 0, 1)) fi; if lookup_name == '#cbhtags' then return strcat('Tags: ', val) fi; return '' fi; if serial_number == 'N4181B5019336' then if lookup_name == '#dthtags' then return val fi fi; return '' Quote:
EDIT: assuming the template returns a list you will probably need to use a funky list separator like ':::'. There is no reason to believe that values don't contain commas or other simple separators. Quote:
Quote:
Last edited by chaley; 03-02-2022 at 09:32 AM. Reason: Added need for odd list separator. |
||||||
03-02-2022, 07:53 AM | #10 |
Grand Sorcerer
Posts: 11,789
Karma: 7029971
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Here is a screen capture of the Libra 2 collection page, generated using the template in the previous post.
|
03-02-2022, 02:56 PM | #11 |
Grand Sorcerer
Posts: 11,789
Karma: 7029971
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
@davidfor: looking again at the code, I now think I was being way too pessimistic about using templates. If you add the checkbox you suggested then:
Apologies for being a bit dense. EDIT: if you want me to send you proof-of-concept code for the above, let me know. It is a small change from what I have already done. Last edited by chaley; 03-02-2022 at 03:00 PM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Kobo Clara HD and Libra 2 Comparisons and Questions | Benjamelon | Which one should I buy? | 8 | 12-28-2021 07:33 PM |
Libra [USA] My new Kobo Libra H2Os from Walmart - questions | Quartz | Kobo Reader | 18 | 02-10-2021 04:23 PM |
New Kobo user (Libra H2O), some questions | gorman42 | Kobo Reader | 11 | 12-02-2019 03:57 PM |
Touch I've bought my Kobo, now some setup questions please | MacEachaidh | Kobo Reader | 11 | 02-14-2012 01:49 AM |
Two setup questions from new user... | radamo | Calibre | 5 | 04-04-2009 10:54 AM |