Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 12-09-2020, 04:45 PM   #1
kaufman
Calibre Companion Fanatic
kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.
 
kaufman's Avatar
 
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.
kaufman is offline   Reply With Quote
Old 12-09-2020, 05:28 PM   #2
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: 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.
chaley is offline   Reply With Quote
Advert
Old 12-09-2020, 06:24 PM   #3
kaufman
Calibre Companion Fanatic
kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.
 
kaufman's Avatar
 
Posts: 873
Karma: 1088610
Join Date: Nov 2006
Device: Galaxy Note 4, Kindle Voyage
Quote:
Originally Posted by chaley View Post
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.
Ahh, thanks buddy. I can wait.
kaufman is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 03:19 AM.


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