mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
bfe31eae65
commit
af594c16f2
@ -1355,10 +1355,12 @@ class DeviceMixin(object): # {{{
|
|||||||
# library view. In this case, simply give up
|
# library view. In this case, simply give up
|
||||||
if not hasattr(self, 'library_view') or self.library_view is None:
|
if not hasattr(self, 'library_view') or self.library_view is None:
|
||||||
return
|
return
|
||||||
|
db = getattr(self.library_view.model(), 'db', None)
|
||||||
|
if db is None:
|
||||||
|
return
|
||||||
# Build a cache (map) of the library, so the search isn't On**2
|
# Build a cache (map) of the library, so the search isn't On**2
|
||||||
self.db_book_title_cache = {}
|
self.db_book_title_cache = {}
|
||||||
self.db_book_uuid_cache = {}
|
self.db_book_uuid_cache = {}
|
||||||
db = self.library_view.model().db
|
|
||||||
for id in db.data.iterallids():
|
for id in db.data.iterallids():
|
||||||
mi = db.get_metadata(id, index_is_id=True)
|
mi = db.get_metadata(id, index_is_id=True)
|
||||||
title = re.sub('(?u)\W|[_]', '', mi.title.lower())
|
title = re.sub('(?u)\W|[_]', '', mi.title.lower())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user