Enhancement Request: Option to quickly select filtered tag browser categories
Bug #1989813 reported by
ownedbycats
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
calibre |
Fix Released
|
Undecided
|
Charles Haley |
Bug Description
See this post: https:/
One idea I've thought of is a button/option that would select all filtered tag browser items in one click and restrict the book list. I've also had situations where this could be useful.
Thank you!
description: | updated |
Changed in calibre: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
@kovid: FWIW: I can't think of a straight forward way to do this. It isn't hard to produce a list of (category, value) pairs from the filtered tag browser. This can be converted to a set of book ids. However, getting that set into the search mechanism is a mystery. Building a search string is out because the set can contain may thousands of ids. Building a search string from the pairs is possible and would probably produce a reasonably-sized search string, but performance will truly be terrible.
One approach I have thought of that is performant would be to create a new search term, for example 'in_tag_browser'. The tag browser would pass the set of filtered book ids to db.cache. A search like "in_tag_ browser: true" would check that the book id is in the current filtered set.
Another option is to filter in view.py.refresh(), ensuring that _map_filtered is restricted to ids in the list. In this case the tag browser would pass the list to view (db.data. set_tag_ browser_ books() or some such). Using this method the restriction would be recomputed on every tag_browser. refresh( ) and would be used whenever the GUI does a refresh. I prefer this approach because a) it doesn't change the name space, and b) operates only on the GUI booklist / cover browser.
Neither of these approaches answers the UI question "how does ask for this behavior"? A checkbox could be added to Prefs/Look & feel/Tag browser, but that might be too hard to use if what one wants is a toggle. Adding another button to the search bar seems overkill. It could be added to the TB context menu.
What do you think?