View Single Post
Old 01-24-2026, 12:16 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 46,070
Karma: 29579912
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Here is the code for a python template:
Code:
python:
def evaluate(book, context):
        from calibre.gui2.ui import get_gui
        v = get_gui().library_view
        row = v.currentIndex().row()
        if row < 0:
            return 'no'
        try:
            return 'yes' if v.model().db.data.index_to_id(row) == book.id else 'no'
        except Exception:
            return 'no'
Then in the emblem rule simply check if the column base don this template is yes. Note I havent actually tested this, but I see no reason why it wont work.

Last edited by kovidgoyal; 01-24-2026 at 03:19 AM.
kovidgoyal is online now   Reply With Quote