View Single Post
Old 02-26-2011, 03:27 PM   #1
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,274
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
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)
meme is offline   Reply With Quote