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 05-31-2022, 10:25 AM   #1
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: 11,795
Karma: 7029971
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Kobo Libra2: template collections not created

I use this template to create collections.
Code:
program:
	globals(serial_number='N4181B1027108');

	if serial_number == 'N4181B1027108' then
		return list_join(
			':@:', 
			list_re($#cbhtags, ',', '^(.*)$', 'CBH Tags: \1'), ',', 
			list_re($authors, '&', '(^.).*', 'Authors: \1'), '&')
	fi;
	if serial_number == 'N4181B5019336' then
		return list_join(
			':@:', 
			list_re($#dthtags, ',', '^(.*)$', 'DTH Tags: \1'), ',',
			list_re($authors, '&', '(^.*)', 'Authors: \1'), '&')
	fi
The problem: no collections are created even though the debug log says the template returned values. Instead I get the following error for all the collections.
Code:
category not added to book.device_collections []
I debugged the problem by copying one book to a new library, preserving structure, and setting the debugging title appropriately. After a few trials I found that the problem is caused by create_collections returning false because nothing is in the collections attributes box. The fix: kobo.driver.py line 3681:
Code:
    @property
    def create_collections(self):
        return (self.manage_collections and self.supports_bookshelves and self.get_pref('create_collections') and
                                (len(self.collections_columns) > 0 or self.use_collections_template))
chaley is offline   Reply With Quote
Old 06-01-2022, 05:35 AM   #2
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,906
Karma: 47303822
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos


Do I need to say anything else?

Last edited by davidfor; 06-01-2022 at 05:38 AM.
davidfor is offline   Reply With Quote
Advert
Old 06-01-2022, 05:44 AM   #3
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: 11,795
Karma: 7029971
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by davidfor View Post


Do I need to say anything else?
Even that is too much. You changed/added a lot of stuff, and it is very easy to miss something you don't frequently (if ever) use. For example, I broke separators in template for loops when I added ranges. I discovered this by accident 10 days later when I connected my Libra before my mini-break. My plugboard uses a loop with an '&' separator to rewrite authors from "LN, FN" to "FN LN", and all the author names became "TEMPLATE ERROR".

for all your work.

Last edited by chaley; 06-01-2022 at 05:47 AM.
chaley is offline   Reply With Quote
Old 06-08-2022, 12:33 AM   #4
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,906
Karma: 47303822
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Just checked the change in and created the pull request. It included the firmware and database version bumps.
davidfor is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Kobo] Collections: using a template chaley Devices 9 05-03-2022 10:36 AM
Libra 2 I still disassembled the KOBO Libra2 LuQQ Kobo Reader 18 11-19-2021 08:36 AM
Aura Calibre resets new Collections created with the Kobo MicheleBS Kobo Reader 8 01-28-2018 10:57 AM
Adding books downloaded via Kobo to Calibre-created collections CharredScribe Library Management 4 01-29-2015 07:08 AM
Collections not created on Sony PRS-T1 ronandginette Devices 7 09-28-2012 11:35 AM


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


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