From 645c3d826905b515a6b250fcce312044510aa5e8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 13 Jul 2021 08:15:28 +0530 Subject: [PATCH] Fix error when user_categories not present --- src/calibre/db/cache.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/db/cache.py b/src/calibre/db/cache.py index 4171e36d81..ba83836c90 100644 --- a/src/calibre/db/cache.py +++ b/src/calibre/db/cache.py @@ -369,7 +369,7 @@ class Cache(object): user_cat_vals = {} if get_user_categories: - user_cats = self.backend.prefs['user_categories'] + user_cats = self._pref('user_categories', {}) for ucat in user_cats: res = [] for name,cat,ign in user_cats[ucat]: @@ -2289,7 +2289,7 @@ class Cache(object): It should be a mapping of book_ids to their corresponding ProxyMetadata objects. ''' - user_cats = self.backend.prefs['user_categories'] + user_cats = self._pref('user_categories', {}) pmm = proxy_metadata_map or {} ans = {}