@BR: I have duplicated not having the VL column updating. I am not sure I can fix it with acceptable performance. The problem is that changes to VL structure do not invalidate any data for the books, meaning that the info shown by the VL column is not repainted. The not-invalidated behavior is reasonable given that VLs are in fact not book data. I would need to somehow force a global repaint whenever the VL structure changes, which would be *very* slow.
Restarting calibre forces the recomputation, as does changing any data in the book. Selecting a book, choosing Edit Metadata, then pressing OK without making any changes refreshes the column. So does selecting multiple books (e.g., all of them), choosing edit metadata multiple, making no changes, then pressing OK.
It is worth noting that the virtual_libraries() formatter function can be *exceedingly* slow if there are a lot of VLs. How many a "lot" is depends on memory and book count. The problem is that if there are a "lot" then some will fall out of calibre's VL cache. If this happens then the VLs must be recomputed from scratch for each book. Sad.
For amusement, for some time I have been working on a "library closed" plugin that will update a tags-like column with all the virtual libraries "containing" a book. This is *much* higher performance because the computations are done once, can be optimized, and doesn't use the cache. Of course, the downside is that the answer (the content of the updated column) is wrong until the library is closed and opened again if the VL structure changes or if metadata affecting VLs changes.
|