View Single Post
Old 07-18-2022, 04:03 AM   #857
allanahk
Connoisseur
allanahk ought to be getting tired of karma fortunes by now.allanahk ought to be getting tired of karma fortunes by now.allanahk ought to be getting tired of karma fortunes by now.allanahk ought to be getting tired of karma fortunes by now.allanahk ought to be getting tired of karma fortunes by now.allanahk ought to be getting tired of karma fortunes by now.allanahk ought to be getting tired of karma fortunes by now.allanahk ought to be getting tired of karma fortunes by now.allanahk ought to be getting tired of karma fortunes by now.allanahk ought to be getting tired of karma fortunes by now.allanahk ought to be getting tired of karma fortunes by now.
 
allanahk's Avatar
 
Posts: 71
Karma: 2202292
Join Date: Nov 2018
Device: Kobo Libra 2
Quote:
Originally Posted by Deobulakenyo View Post
Are these books from kobo store? I only have sideloaded books and the "Nonfiction | 190k words" are not shown on my kobo.

Can i make them appear via calibre?
These are all sideloaded books, and the subtitle info is generated in Calibre. It requires the Kobo Touch Extended driver to put the info of your choice into the subtitle metadata when sending books to your device.

If you want the same setup as I have, you will need the Count Pages plugin which puts the word count into a custom column usually called #words (instructions are in the linked thread). Then in the Kobo touch extended driver configuration, go to "Metadata, on device & advanced", tick "Subtitle", and paste the following into the template editor:

Spoiler:

program:

int_words = raw_field('#words');

# return wordcount in terms of million, e.g. 1m, 1.2m etc
if int_words ># 995000 then
int_words2 = divide(int_words,1000000);
str_words = strcat(format_number(int_words2, '{0: 2.1f}'), '');
if '0' in str_words then
sf_words = format_number(int_words2, '{0: 2.0f}')
else
sf_words = format_number(int_words2, '{0: 2.1f}')
fi;
word_count = strcat(sf_words, 'm')
# wordcount in terms of thousands, e.g. 120k, 230k etc
elif int_words ># 10000 then
int_words2 = divide(int_words,10000);
sf_words = format_number(int_words2, '{0: 2.0f}');
word_count = strcat(sf_words, '0k')
elif int_words ># 1 then
int_words2 = divide(int_words,1000);
sf_words = format_number(int_words2, '{0: 2.0f}');
word_count = strcat(sf_words, 'k')
fi;

subtitle = strcat(field('#genre'), ' |', word_count, ' words')


Note that I have a separate genre column that I use, but you could also use tags - just replace field('#genre') with field('tags') (without the # symbol). You can put any column info that you like! The Calibre template language is quite powerful.
allanahk is offline   Reply With Quote