Quote:
Originally Posted by chaley
FWIW: I'm currently implementing these changes to the base formatter.
|
Thanks chaley, this is going to make it easier and more elegant, and will render some of the functions I've made like selection_count() and from_selection('id') unnecessary, but I will keep them for backward compatibility.
For those interested, once chaley submits his changes, selection_count() can be replaced by a native calibre function as follows:
Code:
list_count(selected_books(), ',')
And instead of using from_selection('id') you can use selected_books(). from_selection() can be still used with other columns and can be useful in
formulas action.
Quote:
Originally Posted by un_pogaz
self.chain_selected_ids = self.gui.current_view().get_selected_ids()
|
This call can be very expensive if the user have a lot of books selected. I already had a similar call in earlier iterations of the plugin (to provide the selection_count as a variable) and had to scrap it because it can slow down chains that does not benefit from it. So this is a non starter for me. I've already tried that path and came out with the conclusion that the call has to be made explicitly by the user only in the chains the might need it, like the solution I linked to in an earlier post. That is also I why I wrote the on-demand selection_count() function instead of providing a chain variable that might not be needed in most of the chains.
As for the rest of the implementation, it can be done in a custom action to avoid cluttering the interface of the plugin with another column. I don't think it provides a better solution to what we already can do in the "Search Using Templates" action, especially with the changes chaley made.