mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Got the ondevice composite column optimization to work.
This commit is contained in:
parent
35bf5ed46e
commit
f25c423261
@ -200,6 +200,11 @@ class CacheRow(list): # {{{
|
|||||||
def __getslice__(self, i, j):
|
def __getslice__(self, i, j):
|
||||||
return self.__getitem__(slice(i, j))
|
return self.__getitem__(slice(i, j))
|
||||||
|
|
||||||
|
def refresh_composites(self):
|
||||||
|
for c in self._composites:
|
||||||
|
self[c] = None
|
||||||
|
self._must_do = True
|
||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
class ResultCache(SearchQueryParser): # {{{
|
class ResultCache(SearchQueryParser): # {{{
|
||||||
@ -914,12 +919,11 @@ class ResultCache(SearchQueryParser): # {{{
|
|||||||
return len(self._map)
|
return len(self._map)
|
||||||
|
|
||||||
def refresh_ondevice(self, db):
|
def refresh_ondevice(self, db):
|
||||||
if self.composites:
|
|
||||||
self.refresh(db)
|
|
||||||
ondevice_col = self.FIELD_MAP['ondevice']
|
ondevice_col = self.FIELD_MAP['ondevice']
|
||||||
for item in self._data:
|
for item in self._data:
|
||||||
if item is not None:
|
if item is not None:
|
||||||
item[ondevice_col] = db.book_on_device_string(item[0])
|
item[ondevice_col] = db.book_on_device_string(item[0])
|
||||||
|
item.refresh_composites()
|
||||||
|
|
||||||
def refresh(self, db, field=None, ascending=True):
|
def refresh(self, db, field=None, ascending=True):
|
||||||
temp = db.conn.get('SELECT * FROM meta2')
|
temp = db.conn.get('SELECT * FROM meta2')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user