View Single Post
Old 01-17-2025, 05:01 PM   #39
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,460
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
If it helps to replicate,

Code:
program:

	if 
		str_in_list($tags, ',', '[Cleanup]', 1, '')
	then 
		list_difference($tags,'[Cleanup]' , ',') 
	else
		list_union($tags,'[Cleanup]' , ',')
	fi
to remove Cleanup, followed by

Code:
from calibre_plugins.action_chains.actions.base import ChainAction

class RefreshAction(ChainAction):

    name = 'Refresh GUI'

    def run(self, gui, settings, chain):
        gui.current_db.data.refresh()
        gui.library_view.model().resort()
The Refresh GUI action doesn't tell the tag browser to refresh the tree. To do that you must (I think) do
Code:
gui.tags_view.recount()
chaley is offline   Reply With Quote