Quote:
Originally Posted by dunhill
Hello @thiago.eec, I'm telling you a question I have.
I have Calibre linked to goodreads but I don't use the reading process, so when I finish reading a book in my calibre I have a status column that will say Read.
Create a custom column for the reading process that depends on the Status column, if it says Read it puts 100 and determines it in numbers.
But I see that I am not taking well the number of books for the month of November.
What could be causing the problem?
|
Hi, @duhill.
I assume your 'goodreadtags' column has multiple values (tags-like), right? Then your template might fail because it compares the whole value of the column. So, if you only have 'Leído' in this column, it will work, but if you have multiple values, like 'Bueno, Leído', it fails.
Check if your '#progresos' column is really showing '100' for all the five books. If not, you can correct it changing 'switch_if' for 'in_list':
Code:
{#goodreadtags:'in_list($, ',', 'Leído', '100', '')'}
P.S.: The above function still has a small problem... if the searched string is part of a larger string, it still matches (e.g.: it would match 'Leídoo' too). Since I'm not very good with the template language, I can suggest something using the Python Mode that will work perfectly, although it might look more complicated:
Code:
python:
def evaluate(book, context):
if book.get('#goodreadtags'):
if 'Leído' in book.get('#goodreadtags'):
return '100'
else:
return ''
else:
return ''
I'm not sure about the performance difference, though.