mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
vacuum fts db when running check library as well
This commit is contained in:
parent
a4cbe12a43
commit
91b29481df
@ -1282,6 +1282,8 @@ class DB:
|
|||||||
|
|
||||||
def vacuum(self):
|
def vacuum(self):
|
||||||
self.execute('VACUUM')
|
self.execute('VACUUM')
|
||||||
|
if self.fts_enabled:
|
||||||
|
self.fts.vacuum()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def user_version(self):
|
def user_version(self):
|
||||||
|
@ -20,7 +20,6 @@ from .pool import Pool
|
|||||||
from .schema_upgrade import SchemaUpgrade
|
from .schema_upgrade import SchemaUpgrade
|
||||||
|
|
||||||
# TODO: calibre export/import should preserve indexed data
|
# TODO: calibre export/import should preserve indexed data
|
||||||
# TODO: check library and vacuuming of fts db
|
|
||||||
|
|
||||||
|
|
||||||
def print(*args, **kwargs):
|
def print(*args, **kwargs):
|
||||||
@ -80,6 +79,10 @@ class FTS:
|
|||||||
conn = self.get_connection()
|
conn = self.get_connection()
|
||||||
conn.execute('DELETE FROM fts_db.dirtied_formats')
|
conn.execute('DELETE FROM fts_db.dirtied_formats')
|
||||||
|
|
||||||
|
def vacuum(self):
|
||||||
|
conn = self.get_connection()
|
||||||
|
conn.execute('VACUUM')
|
||||||
|
|
||||||
def remove_dirty(self, book_id, fmt):
|
def remove_dirty(self, book_id, fmt):
|
||||||
conn = self.get_connection()
|
conn = self.get_connection()
|
||||||
conn.execute('DELETE FROM fts_db.dirtied_formats WHERE book=? AND format=?', (book_id, fmt.upper()))
|
conn.execute('DELETE FROM fts_db.dirtied_formats WHERE book=? AND format=?', (book_id, fmt.upper()))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user