The nice thing about open source is you can always look at the source.
In this case, new_api is the Cache class in
https://github.com/kovidgoyal/calibr...re/db/cache.py It appears to only have
library_id and
dbpath properties. dbpath contains the library name, but as part of the full abspath to 'metadata.db' for that library.
The other approach is to look at the code for something that already has what you want. In this case, the Choose Library action knows about library names. I keep a fork of calibre checkouted and used find grep on 'Switch/create library' to find it in:
https://github.com/kovidgoyal/calibr...ose_library.py
That action has a method
library_name(), which you can call from your plugin as
self.gui.iactions['Choose Library'].library_name(), or you can look at the code and find that what it really does it give you the basename of the
self.gui.current_db.libary_path.