View Single Post
Old 07-10-2023, 09:33 AM   #16
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,476
Karma: 8025702
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Comfy.n View Post
@chaley Hi! I just tested the new layout actions, running Calibre from source, as I found it cool to have another distinctive way to visually acknowledge library switching - besides a different library icon.

Upon running the chain, I get:

Code:
Traceback (most recent call last):
  File "calibre_plugins.action_chains.action", line 448, in run_chain
  File "calibre_plugins.action_chains.chains", line 389, in run
  File "calibre_plugins.action_chains.chains", line 209, in _run_loop
  File "calibre_plugins.action_chains.chains", line 348, in refresh_gui
  File "C:\users\user\calibre-master\src\calibre\db\legacy.py", line 284, in all_ids
AttributeError: 'LibraryDatabase' object has no attribute 'new_api'
There's also a validation message:

Code:
Menu entry: mylib2 (plugin_name: Choose Library) cannot be found
The chain I tested was set up this way: 1 - a Calibre Action to quick switch to a given library and 2 - Hide Cover Grid

It runs the desired actions, but the message is displayed.
As far as I can tell this is a problem in Action Chains. It seems to a) lose the library plugin action, and b) lose the database when a chain changes the library. I suggest that you report the problem there.

To test I built an action chain that turns off the search bar if the target library is "Library.test_small". Note the chain condition that tests the library name. I then set up an event to call that chain whenever the library is changed. This works fine. However, a chain that contains a single action to change the library works only once.

Here is my test action chain:
HideSearchBar.zip

Here is the event definition:
Click image for larger version

Name:	Clipboard01.jpg
Views:	366
Size:	57.5 KB
ID:	202575
chaley is offline   Reply With Quote