View Single Post
Old 11-30-2025, 06:28 AM   #15
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,529
Karma: 8075744
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Katja_hbg View Post
Nice.
I added it yesterday and it works immediately.

But ... in some cases I buy books not in right order
e.g. I own series part #1 #3 #5
For book 3 the tooltip shows: book 3 of 3.

Could you please expand the example to show:
book 3 of 5 (some are missing) or
book 3 of 3 (highest number of the serie is 5)
Here is a template that does more than you asked. Change it as you wish.
Click image for larger version

Name:	Clipboard01.jpg
Views:	20
Size:	172.2 KB
ID:	219493

Code:
program:
    def format(i):
        ii = floor(i);
        return if ii ==# i then ii else i fi
    fed;

    if $series then
        series_book_count = book_count('series:"""=' & $series & '"""', 0);
        indices = book_values('series_index', 'series:"""=' & $series & '"""', ',', 0);
        max_index = -999;
        min_index = 999999999999999;
        for i in indices:
            if i ># max_index then
                max_index = format(i)
            fi;
            if i <# min_index then
                min_index = format(i)
            fi
        rof;
        return f_string("Series: {$series}<br>" &
                         "Series index: {$series_index}<br>" &
                         "Lowest series index: {min_index}<br>" & 
                         "Highest series index: {max_index}<br>" & 
                         "Books in series: {series_book_count} ")
    fi;
    return 'This book is not in a series'
chaley is offline   Reply With Quote