View Single Post
Old 10-14-2022, 11:16 AM   #3
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,731
Karma: 2197770
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Quote:
Originally Posted by kovidgoyal View Post
Not sure what you are asking for exactly, but you first get the set of all book ids in the current virtual library. THen after that call

Code:
ans = set()
for book_id in book_ids:
   ans |= {x for x in db.new_api.field_ids_for('tags', book_id)}
and use get_id_map() to convert the ids from ans into names.
Hi Kovid - thanks for the reply. What I wanted was exactly the same output that the direct db functions above give me, of pairs of ids with their text value. e.g. all the unique author id + their name combinations.

So it appears that indeed the answer is I need to iterate over all the books and build up my own (unique) sets...
kiwidude is offline   Reply With Quote