From 2de76958ce55857fe3f8aaff86932ac62fc02187 Mon Sep 17 00:00:00 2001 From: Timothy Legge Date: Mon, 12 Sep 2011 22:44:46 -0300 Subject: [PATCH] Kobo - Only process supported collections --- src/calibre/devices/kobo/driver.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/calibre/devices/kobo/driver.py b/src/calibre/devices/kobo/driver.py index 528057dad9..fa4796a5a9 100644 --- a/src/calibre/devices/kobo/driver.py +++ b/src/calibre/devices/kobo/driver.py @@ -653,6 +653,15 @@ class KOBO(USBMS): debug_print(' Commit: Set FavouritesIndex') def update_device_database_collections(self, booklists, collections_attributes, oncard): + # Only process categories in this list + supportedcategories = { + "Im_Reading":1, + "Read":2, + "Closed":3, + "Shortlist":4, + # "Preview":99, # Unsupported as we don't want to change it + } + # Define lists for the ReadStatus readstatuslist = { "Im_Reading":1, @@ -692,6 +701,7 @@ class KOBO(USBMS): # Process any collections that exist for category, books in collections.items(): + if category in supportedcategories: debug_print("Category: ", category, " id = ", readstatuslist.get(category)) for book in books: debug_print(' Title:', book.title, 'category: ', category)