View Single Post
Old 03-06-2023, 02:02 PM   #1
charlweed
Enthusiast
charlweed began at the beginning.
 
Posts: 27
Karma: 30
Join Date: Jul 2011
Device: none
How can I use the database API to get a collection of all known series?

I'm writing a plugin, and I'd like to obtain a list of all the series in all the books. I'll use the list to answer questions like "Is there a series with this name 'SomeName'" and "Which series have a name that starts with the string 'SomePrefix'"
I've tried various approaches including:
Code:
series_fields = self.db_cache_api.fields['series']
for val, book_ids in series_fields.iter_searchable_values(
    self.db_cache_api.get_metadata,
    self.db_cache_api.all_book_ids()
):
    print("val=\"%s\"" % val)
But the results are always empty.

Thanks for any help!
charlweed is offline   Reply With Quote