![]() |
#1 |
Calibre Companion Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 873
Karma: 1088610
Join Date: Nov 2006
Device: Galaxy Note 4, Kindle Voyage
|
Problem programming a custom Column
I've been using this program for a column for ages:
program: first_non_empty( str_in_list(field('tags'),",", "_List.Active", "Active", ""), str_in_list(field('tags'),",", "_List.Collections","Collections", ""), str_in_list(field('tags'),",","_List.Favorites", "Favorites","") ) I recently upgraded from. few version ago, and now for the columns that don't match any of the options above I get an error that says: TEMPLATE ERROR expected string or bytes-like object. If I change it to: program: first_non_empty( str_in_list(field('tags'),",", "_List.Active", "Active", ""), str_in_list(field('tags'),",", "_List.Collections","Collections", ""), str_in_list(field('tags'),",","_List.Favorites", "Favorites",""), "Z" ) It work as before, except that now I have a non-empty value where I don't want it. Is there some rules where custom columns can't be empty any more? Is there an option I need to set to allow this? Any help would be appreciated. Thanks. |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,440
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
This is a regression in first_non_empty introduced in calibre 5.6. It fixed in the next calibre release, probably this Friday. If you don't want to wait, install calibre 5.5.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Calibre Companion Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 873
Karma: 1088610
Join Date: Nov 2006
Device: Galaxy Note 4, Kindle Voyage
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Using RE to extract pattern from custom column into another custom column | activedirectory | Library Management | 1 | 12-15-2019 08:07 PM |
[Android] Problem with custom column not syncing | Pinkie | Calibre Companion | 5 | 12-02-2016 07:29 AM |
Custom column problem | Statch | Calibre | 6 | 06-14-2013 02:03 PM |
Need help with programming a column based on previous data in the same column | seaquay | Library Management | 2 | 06-13-2012 12:19 PM |
Custom Column Problem | MSJim | Calibre | 7 | 09-08-2010 05:07 PM |