User Categories remain after deleted
While testing out integrating user categories into my plugin (which works well - Chaley thanks for the tip about how to access it), I found that after I deleted a category (it disappears from the left window), I could still see information on it - even after stopping and restarting Calibre. And if I recreated the user category with the same name with no data, I could still see the info. But when I added an entry to the user category, I correctly pick up the new number of books in the category.
Is there a method I should be calling to make sure I have the current information or is this not working correctly?
I'm using something like this to read the data:
...
library_book = self.db.get_metadata(id, index_is_id=True)
if library_book.user_categories:
for c in library_book.user_categories.keys():
if library_book.user_categories[c]:
book['user_categories'].append(c)
|