View Single Post
Old 04-30-2023, 05:05 AM   #112
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: 11,774
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by BetterRed View Post
I see I forgot to thank you for this, so I'm doing it now. Thanks
You are welcome
Quote:
It works of course but because I use the file manager to add/delete the file to/from the books data folder the column icon doesn't appear/disappear in real time.

Re-apply current sort (F5) doesn't do the trick, perhaps it could/should. Header menu->Restore default layout doesn't do it either. Apart from restart, the only way I've found to get the icon updated, is switching to another library and back again.

BR
Ways to refresh it are (some of these might require the next release -- I don't remember beyond what I noted):
  • Using the link to open a file explorer on a book or a book's data folder resets the indicator for that book. In the next release it checks once per second for 5 minutes after you open the explorer. If you do your "File system operations" using that explorer then the icon will automatically update.
  • Using "Add data files to books" does the reset for the affected books.
  • Selecting the book, doing Edit Metadata, changing nothing, then hit OK, does it for that book.
  • Selecting all books then doing Edit Metadata (bulk), changing nothing, then pressing OK does it.
  • Editing any cell, for example Title, then hitting return without changing anything does it for that book.
  • This python template does it for all books:
    Code:
    python:
    def evaluate(book, context):
    	db = context.db.new_api
    	db.clear_extra_files_cache(None)
    	return 'Ok'
  • Use a Python code Action chain, probably with a shortcut. The code is
    Code:
    def run(gui, settings, chain):
        db = gui.current_db.new_api
        db.clear_extra_files_cache(None)
        gui.current_view().model().refresh()
  • Of course and as you found, restarting or switching libraries does it.
I don't think doing it on every sort is a good idea, as that would affect performance by making the cache near useless. It also isn't any more discoverable than the above operations.

I considered adding a global refresh action but Kovid thought that such a thing wouldn't be any more discoverable than (for example) Select All then Edit Metadata (bulk) then OK without changing anything.
chaley is offline   Reply With Quote