From d5d0a97d377be56587abc091f0ddf39c21d099ce Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 14 Sep 2024 08:50:30 +0530 Subject: [PATCH] Add a note about get_item_id() being slow --- src/calibre/db/cache.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/db/cache.py b/src/calibre/db/cache.py index 10a9c48625..d28d1f4558 100644 --- a/src/calibre/db/cache.py +++ b/src/calibre/db/cache.py @@ -947,7 +947,8 @@ class Cache: @read_api def get_item_id(self, field, item_name): - ' Return the item id for item_name (case-insensitive) or None if not found ' + '''' Return the item id for item_name (case-insensitive) or None if not found. + This function is very slow if doing lookups for multiple names use either get_item_ids() or get_item_name_map(). ''' q = icu_lower(item_name) try: for item_id, item_val in self.fields[field].table.id_map.items():