View Single Post
Old 03-02-2022, 04:46 AM   #8
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
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.
davidfor is offline   Reply With Quote