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-14-2014, 08:59 AM   #1
Vortex
Groupie
Vortex began at the beginning.
 
Vortex's Avatar
 
Posts: 171
Karma: 10
Join Date: Dec 2008
Device: Likebook Mars
Need help with 'Has Cover' custom column

I have the 'Has Cover' custom column in my libraries but the original library structure came from someone else so I dont know how it's supposed to work. It doesn't change to 'Yes' when a cover is added to a book and the column entries contains a mixture of blanks, some Yes's and a lot of random single words. This is what's in the column properties, can anyone help me out with this?
Thanks.

Vortex is offline   Reply With Quote
Old 12-14-2014, 09:23 AM   #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,346
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
That column should show Yes if a book has both a series and a cover, blank otherwise. That is what it does in my test library, assuming I have transcribed the template correctly.
Code:
{series:'contains($, '.', has_cover (), $)'}
chaley is offline   Reply With Quote
Advert
Old 12-14-2014, 12:51 PM   #3
Vortex
Groupie
Vortex began at the beginning.
 
Vortex's Avatar
 
Posts: 171
Karma: 10
Join Date: Dec 2008
Device: Likebook Mars
I didn't realize there's a separate template for each library. When I checked each library the offending ones had title instead of series at the beginning:

Code:
{title:'contains($, ' ', has_cover (), $)'}
Working perfect now. Why is it dependent on there being something in the Series column?
Vortex is offline   Reply With Quote
Old 12-14-2014, 01:00 PM   #4
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,346
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Vortex View Post
I didn't realize there's a separate template for each library. When I checked each library the offending ones had title instead of series at the beginning:

Code:
{title:'contains($, ' ', has_cover (), $)'}
Working perfect now. Why is it dependent on there being something in the Series column?
The template in the first post references series. The template you just posted references title. The first uses a regular expression asking if there is a character in series. The second uses a regular expression asking if there is a space in the title. If there is then the template displays Yes if it has a cover or nothing if it doesn't. If the title contains no spaces then the column displays the title.

If you are asking why the first template checks for a series before checking has_cover(), I have no idea. Nor do I understand what the "title" template is intended to accomplish.
chaley is offline   Reply With Quote
Old 12-14-2014, 01:07 PM   #5
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,644
Karma: 29710510
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Vortex View Post
I didn't realize there's a separate template for each library. When I checked each library the offending ones had title instead of series at the beginning:

One reason to have separate physical libraries is to have different custom columns, or the same custom columns with different templates

Why is it dependent on there being something in the Series column?
You'd need to ask the designer of the custom column that question - readers of unknown minds are in short supply 'round here

BR
BetterRed is offline   Reply With Quote
Advert
Old 12-14-2014, 09:23 PM   #6
BookJunkieLI
Evangelist
BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.
 
BookJunkieLI's Avatar
 
Posts: 435
Karma: 572984
Join Date: Jan 2010
Location: Long Island
Device: Kobo Libra 2, Kindle 4, Nook Gl4, Nook STR, REB 1100, Ebookwise 1500,
Quote:
Originally Posted by chaley View Post
The template in the first post references series. The template you just posted references title. The first uses a regular expression asking if there is a character in series. The second uses a regular expression asking if there is a space in the title. If there is then the template displays Yes if it has a cover or nothing if it doesn't. If the title contains no spaces then the column displays the title.

If you are asking why the first template checks for a series before checking has_cover(), I have no idea. Nor do I understand what the "title" template is intended to accomplish.
For the title template, I found that if you replace the ' ' with a '.' it will return either a Yes or a blank space. I couldn't find an instance of it returning the title itself using that variation.
BookJunkieLI is offline   Reply With Quote
Old 12-15-2014, 04:02 AM   #7
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,346
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by BookJunkieLI View Post
For the title template, I found that if you replace the ' ' with a '.' it will return either a Yes or a blank space. I couldn't find an instance of it returning the title itself using that variation.
Given that the title cannot ever be empty, contains() will always be true therefore has_cover() will always be called. You could replace the template with the following:
Code:
{:'has_cover()'}
or
Code:
program: has_cover()
chaley is offline   Reply With Quote
Old 12-15-2014, 05:17 AM   #8
Vortex
Groupie
Vortex began at the beginning.
 
Vortex's Avatar
 
Posts: 171
Karma: 10
Join Date: Dec 2008
Device: Likebook Mars
I presumed there must be a good technical reason why the template was dependent on there being a Series to function, but I guess not as this works perfectly without anything in the Series column.

Code:
{:'has_cover()'}
Thank you Chaley
Vortex is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom column returns value based on value of another custom column? calvin-c Calibre 3 09-14-2013 02:24 PM
Custom yes/no column built from long text column Philantrop Library Management 7 03-23-2013 07:44 PM
how to move value(s) of tag column to a custom made column zoorakhan Library Management 0 12-08-2012 03:53 AM
custom date column from two state column Dopedangel Library Management 7 01-03-2012 08:20 AM
Can custom book data be displayed in a custom column? kiwidude Development 9 03-02-2011 05:35 AM


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


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